diff --git a/src/borg/archiver/prune_cmd.py b/src/borg/archiver/prune_cmd.py index 7e36e22692e..2aff6cef0be 100644 --- a/src/borg/archiver/prune_cmd.py +++ b/src/borg/archiver/prune_cmd.py @@ -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+)?" @@ -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=)" + ) subparser.add_argument( "--keep-minutely", dest="minutely", type=int, default=0, help="number of minutely archives to keep" )