--destroy-incompatible now only rolls back if needed

This commit is contained in:
Edwin Eefting 2023-09-26 18:39:03 +02:00
parent 06420978d5
commit f8cd77e6e4
No known key found for this signature in database
GPG Key ID: 0F3C35D8E9887737
2 changed files with 6 additions and 3 deletions

View File

@ -33,8 +33,8 @@ class ZfsAutobackup(ZfsAuto):
if args.allow_empty:
args.min_change = 0
if args.destroy_incompatible:
args.rollback = True
# if args.destroy_incompatible:
# args.rollback = True
if args.resume:
self.warning("The --resume option isn't needed anymore (it's autodetected now)")
@ -99,7 +99,7 @@ class ZfsAutobackup(ZfsAuto):
group.add_argument('--force', '-F', action='store_true',
help='Use zfs -F option to force overwrite/rollback. (Useful with --strip-path=1, but use with care)')
group.add_argument('--destroy-incompatible', action='store_true',
help='Destroy incompatible snapshots on target. Use with care! (implies --rollback)')
help='Destroy incompatible snapshots on target. Use with care! (also does rollback of dataset)')
group.add_argument('--ignore-transfer-errors', action='store_true',
help='Ignore transfer errors (still checks if received filesystem exists. useful for '
'acltype errors)')

View File

@ -1038,6 +1038,9 @@ class ZfsDataset:
snapshot.destroy()
self.snapshots.remove(snapshot)
if len(incompatible_target_snapshots)>0:
self.rollback()
def sync_snapshots(self, target_dataset, features, show_progress, filter_properties, set_properties,
ignore_recv_exit_code, holds, rollback, decrypt, encrypt, also_other_snapshots,