Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added --keep-all, as an alias for '--keep-last <inf>', as an option… #7462

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/borg/archiver/prune_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,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
if args.format is not None:
Expand Down Expand Up @@ -300,6 +300,13 @@ def build_parser_prune(self, subparsers, common_parser, mid_common_parser):
action=Highlander,
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",
Expand Down