Skip to content

Commit 61df3bb

Browse files
Michael DeyasoThomasWaldmann
authored andcommitted
Added --keep-all, as an alias for '--keep-last <inf>', as an option for borg-prune. Fixes #6656
1 parent 3ebae35 commit 61df3bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/borg/archiver/prune_cmd.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def do_prune(self, args, repository, manifest):
138138
'At least one of the "keep-within", "keep-last", '
139139
'"keep-secondly", "keep-minutely", "keep-hourly", "keep-daily", '
140140
'"keep-weekly", "keep-monthly", "keep-13weekly", "keep-3monthly", '
141-
'or "keep-yearly" settings must be specified.'
141+
'"keep-yearly", or "keep-all" settings must be specified.'
142142
)
143143

144144
if args.format is not None:
@@ -320,6 +320,13 @@ def build_parser_prune(self, subparsers, common_parser, mid_common_parser):
320320
action=Highlander,
321321
help="number of secondly archives to keep",
322322
)
323+
subparser.add_argument(
324+
"--keep-all",
325+
dest="secondly",
326+
action="store_const",
327+
const=float("inf"),
328+
help="keep all archives (alias of --keep-last=<infinite>)",
329+
)
323330
subparser.add_argument(
324331
"--keep-minutely",
325332
dest="minutely",

0 commit comments

Comments
 (0)