Initial ZFS clones support

This commit is contained in:
Phil Krylov
2021-06-22 19:09:31 +03:00
committed by Phil Krylov
parent 07cb7cfad4
commit e11c332808
3 changed files with 55 additions and 26 deletions

View File

@ -372,6 +372,9 @@ class ZfsAutobackup:
:type source_node: ZfsNode
"""
def make_target_name(source_dataset):
return self.args.target_path + "/" + source_dataset.lstrip_path(self.args.strip_path)
send_pipes = self.get_send_pipes(source_node.verbose)
recv_pipes = self.get_recv_pipes(target_node.verbose)
@ -387,7 +390,7 @@ class ZfsAutobackup:
try:
# determine corresponding target_dataset
target_name = self.args.target_path + "/" + source_dataset.lstrip_path(self.args.strip_path)
target_name = make_target_name(source_dataset)
target_dataset = ZfsDataset(target_node, target_name)
target_datasets.append(target_dataset)
@ -414,7 +417,8 @@ class ZfsAutobackup:
destroy_incompatible=self.args.destroy_incompatible,
send_pipes=send_pipes, recv_pipes=recv_pipes,
decrypt=self.args.decrypt, encrypt=self.args.encrypt,
zfs_compressed=self.args.zfs_compressed)
zfs_compressed=self.args.zfs_compressed,
make_target_name=make_target_name)
except Exception as e:
fail_count = fail_count + 1
source_dataset.error("FAILED: " + str(e))