mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-13 22:47:12 +03:00
wip
This commit is contained in:
parent
f114114993
commit
b56e1d1a84
@ -973,7 +973,7 @@ class ZfsDataset():
|
|||||||
return(snapshot)
|
return(snapshot)
|
||||||
|
|
||||||
|
|
||||||
def sync_snapshots(self, target_dataset, show_progress=False, resume=True, filter_properties=[], set_properties=[], ignore_recv_exit_code=False):
|
def sync_snapshots(self, target_dataset, show_progress=False, resume=True, filter_properties=[], set_properties=[], ignore_recv_exit_code=False, source_holds=True):
|
||||||
"""sync our snapshots to target_dataset"""
|
"""sync our snapshots to target_dataset"""
|
||||||
|
|
||||||
|
|
||||||
@ -1066,9 +1066,11 @@ class ZfsDataset():
|
|||||||
|
|
||||||
#hold the new common snapshots and release the previous ones
|
#hold the new common snapshots and release the previous ones
|
||||||
target_snapshot.hold()
|
target_snapshot.hold()
|
||||||
source_snapshot.hold()
|
if source_holds:
|
||||||
|
source_snapshot.hold()
|
||||||
if prev_source_snapshot:
|
if prev_source_snapshot:
|
||||||
prev_source_snapshot.release()
|
if source_holds:
|
||||||
|
prev_source_snapshot.release()
|
||||||
target_dataset.find_snapshot(prev_source_snapshot).release()
|
target_dataset.find_snapshot(prev_source_snapshot).release()
|
||||||
|
|
||||||
#we may destroy the previous snapshot now, if we dont want it anymore
|
#we may destroy the previous snapshot now, if we dont want it anymore
|
||||||
@ -1374,7 +1376,7 @@ class ZfsAutobackup:
|
|||||||
if not target_dataset.parent.exists:
|
if not target_dataset.parent.exists:
|
||||||
target_dataset.parent.create_filesystem(parents=True)
|
target_dataset.parent.create_filesystem(parents=True)
|
||||||
|
|
||||||
source_dataset.sync_snapshots(target_dataset, show_progress=self.args.progress, resume=self.args.resume, filter_properties=filter_properties, set_properties=set_properties, ignore_recv_exit_code=self.args.ignore_transfer_errors)
|
source_dataset.sync_snapshots(target_dataset, show_progress=self.args.progress, resume=self.args.resume, filter_properties=filter_properties, set_properties=set_properties, ignore_recv_exit_code=self.args.ignore_transfer_errors, source_holds= not self.args.no_holds)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
source_dataset.error(str(e))
|
source_dataset.error(str(e))
|
||||||
if self.args.debug:
|
if self.args.debug:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user