Replace `--prefix` with `-a` for borg v1.2.2 also.

* src/vorta/borg/prune.py (BorgPruneJob.prepare)
This commit is contained in:
real-yfprojects 2022-10-11 20:03:05 +02:00 committed by Manu
parent 0188b753b4
commit 14d587876e
1 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,5 @@
from vorta.store.models import RepoModel
from vorta.utils import format_archive_name
from vorta.utils import borg_compat, format_archive_name
from .borg_job import BorgJob
@ -46,7 +46,11 @@ class BorgPruneJob(BorgJob):
if profile.prune_prefix:
formatted_prune_prefix = format_archive_name(profile, profile.prune_prefix)
pruning_opts += ['--prefix', formatted_prune_prefix]
if borg_compat.check('V122'):
pruning_opts += ['-a', formatted_prune_prefix + '*'] # sh: pattern
else:
pruning_opts += ['--prefix', formatted_prune_prefix]
if profile.prune_keep_within:
pruning_opts += ['--keep-within', profile.prune_keep_within]