This commit is contained in:
Edwin Eefting 2015-11-24 12:28:28 +01:00
parent 6eea707d37
commit 297b818051

View File

@ -204,9 +204,22 @@ def zfs_get_snapshots(ssh_to, filesystems, backup_name):
"""transfer a zfs snapshot from source to target. both can be either local or via ssh."""
"""transfer a zfs snapshot from source to target. both can be either local or via ssh.
specify buffer_size to use mbuffer (or alike) to apply buffering where neccesary
local to local:
local send -> local buffer -> local receive
local to remote and remote to local:
local send -> local buffer -> ssh -> remote buffer -> remote receive
remote send -> remote buffer -> ssh -> local buffer -> local receive
remote to remote:
remote send -> remote buffer -> ssh -> local buffer -> ssh -> remote buffer -> remote receive
"""
def zfs_transfer(ssh_source, source_filesystem, first_snapshot, second_snapshot,
ssh_target, target_filesystem):
ssh_target, target_filesystem, buffer_size=None):
#### build source command
source_cmd=[]
@ -229,6 +242,10 @@ def zfs_transfer(ssh_source, source_filesystem, first_snapshot, second_snapshot,
source_cmd.append(source_filesystem + "@" + second_snapshot)
# if ssh_source != "local":
# #add buffer
# source_cmd.append("|dd")
#### build target command
target_cmd=[]
@ -352,6 +369,8 @@ for source_filesystem in source_filesystems:
ssh_target=args.ssh_target, target_filesystem=target_filesystem)
#update target_snapshot list for later cleanup
if not target_filesystem in target_snapshots:
target_snapshots[target_filesystem]=[]
target_snapshots[target_filesystem].append(send_snapshot)
latest_target_snapshot=send_snapshot