1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

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

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 @@ def prepare(cls, profile):
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]