mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-06-05 01:33:00 +03:00
--destroy-incompatible now only rolls back if needed
This commit is contained in:
parent
06420978d5
commit
f8cd77e6e4
@ -33,8 +33,8 @@ class ZfsAutobackup(ZfsAuto):
|
|||||||
if args.allow_empty:
|
if args.allow_empty:
|
||||||
args.min_change = 0
|
args.min_change = 0
|
||||||
|
|
||||||
if args.destroy_incompatible:
|
# if args.destroy_incompatible:
|
||||||
args.rollback = True
|
# args.rollback = True
|
||||||
|
|
||||||
if args.resume:
|
if args.resume:
|
||||||
self.warning("The --resume option isn't needed anymore (it's autodetected now)")
|
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',
|
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)')
|
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',
|
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',
|
group.add_argument('--ignore-transfer-errors', action='store_true',
|
||||||
help='Ignore transfer errors (still checks if received filesystem exists. useful for '
|
help='Ignore transfer errors (still checks if received filesystem exists. useful for '
|
||||||
'acltype errors)')
|
'acltype errors)')
|
||||||
|
@ -1038,6 +1038,9 @@ class ZfsDataset:
|
|||||||
snapshot.destroy()
|
snapshot.destroy()
|
||||||
self.snapshots.remove(snapshot)
|
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,
|
def sync_snapshots(self, target_dataset, features, show_progress, filter_properties, set_properties,
|
||||||
ignore_recv_exit_code, holds, rollback, decrypt, encrypt, also_other_snapshots,
|
ignore_recv_exit_code, holds, rollback, decrypt, encrypt, also_other_snapshots,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user