This commit is contained in:
Edwin Eefting
2022-01-17 22:54:27 +01:00
parent f2a3221911
commit 14d45667de
2 changed files with 32 additions and 30 deletions

View File

@ -18,23 +18,35 @@ class ZfsAutobackup(ZfsAuto):
def __init__(self, argv, print_arguments=True):
super(ZfsAutobackup, self).__init__(argv, print_arguments)
def parse_args(self, argv):
args=super(ZfsAutobackup, self).parse_args(argv)
if args.allow_empty:
args.min_change = 0
if args.destroy_incompatible:
args.rollback = True
if args.resume:
self.warning("The --resume option isn't needed anymore (its autodetected now)")
if args.raw:
self.warning(
"The --raw option isn't needed anymore (its autodetected now). Also see --encrypt and --decrypt.")
if args.compress and args.ssh_source is None and args.ssh_target is None:
self.warning("Using compression, but transfer is local.")
if args.compress and args.zfs_compressed:
self.warning("Using --compress with --zfs-compressed, might be inefficient.")
return args
def get_parser(self):
"""extend common parser with extra stuff needed for zfs-autobackup"""
parser=super(ZfsAutobackup, self).get_parser()
group=parser.add_argument_group("Selection options")
group.add_argument('--ignore-replicated', action='store_true', help=argparse.SUPPRESS)
group.add_argument('--exclude-unchanged', action='store_true',
help='Exclude datasets that have no changes since any last snapshot. (Useful in combination with proxmox HA replication)')
group.add_argument('--exclude-received', action='store_true',
help='Exclude datasets that have the origin of their autobackup: property as "received". '
'This can avoid recursive replication between two backup partners.')
group.add_argument('--property-format', metavar='FORMAT', default="autobackup:{}",
help='Dataset selection string format. Default: %(default)s')
group=parser.add_argument_group("Snapshot options")
group.add_argument('--no-snapshot', action='store_true',
help='Don\'t create new snapshots (useful for finishing uncompleted backups, or cleanups)')