Skip to content

Commit

Permalink
Added --keep-all, as an alias for '--keep-last <inf>', as an option…
Browse files Browse the repository at this point in the history
… for borg-prune. Fixes #6656
  • Loading branch information
Michael Deyaso committed Mar 22, 2023
1 parent 46f1cda commit e69fbe9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/borg/archiver/prune_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def do_prune(self, args, repository, manifest):
self.print_error(
'At least one of the "keep-within", "keep-last", '
'"keep-secondly", "keep-minutely", "keep-hourly", "keep-daily", '
'"keep-weekly", "keep-monthly" or "keep-yearly" settings must be specified.'
'"keep-weekly", "keep-monthly", "keep-yearly" or "keep-all" settings must be specified.'
)
return self.exit_code
checkpoint_re = r"\.checkpoint(\.\d+)?"
Expand Down Expand Up @@ -269,6 +269,13 @@ def build_parser_prune(self, subparsers, common_parser, mid_common_parser):
default=0,
help="number of secondly archives to keep",
)
subparser.add_argument(
"--keep-all",
dest="secondly",
action="store_const",
const=float("inf"),
help="keep all archives (alias of --keep-last=<infinite>)",
)
subparser.add_argument(
"--keep-minutely", dest="minutely", type=int, default=0, help="number of minutely archives to keep"
)
Expand Down

0 comments on commit e69fbe9

Please sign in to comment.