mirror of
https://github.com/psy0rz/zfs_autobackup.git
synced 2025-04-11 22:40:01 +03:00
fixes
This commit is contained in:
parent
6eea707d37
commit
297b818051
@ -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,
|
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
|
#### build source command
|
||||||
source_cmd=[]
|
source_cmd=[]
|
||||||
@ -229,6 +242,10 @@ def zfs_transfer(ssh_source, source_filesystem, first_snapshot, second_snapshot,
|
|||||||
|
|
||||||
source_cmd.append(source_filesystem + "@" + second_snapshot)
|
source_cmd.append(source_filesystem + "@" + second_snapshot)
|
||||||
|
|
||||||
|
# if ssh_source != "local":
|
||||||
|
# #add buffer
|
||||||
|
# source_cmd.append("|dd")
|
||||||
|
|
||||||
|
|
||||||
#### build target command
|
#### build target command
|
||||||
target_cmd=[]
|
target_cmd=[]
|
||||||
@ -352,6 +369,8 @@ for source_filesystem in source_filesystems:
|
|||||||
ssh_target=args.ssh_target, target_filesystem=target_filesystem)
|
ssh_target=args.ssh_target, target_filesystem=target_filesystem)
|
||||||
|
|
||||||
#update target_snapshot list for later cleanup
|
#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)
|
target_snapshots[target_filesystem].append(send_snapshot)
|
||||||
|
|
||||||
latest_target_snapshot=send_snapshot
|
latest_target_snapshot=send_snapshot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user