From ba89dc8bb28a6b4ccc35ce832932c18bcc69cd85 Mon Sep 17 00:00:00 2001 From: Marius van Witzenburg Date: Thu, 5 Apr 2018 09:23:39 +0200 Subject: [PATCH] Use persistent connections for 600 seconds (10min) --- zfs_autobackup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zfs_autobackup b/zfs_autobackup index 44663ab..17eb8f1 100755 --- a/zfs_autobackup +++ b/zfs_autobackup @@ -38,7 +38,7 @@ def run(cmd, input=None, ssh_to="local", tab_split=False, valid_exitcodes=[ 0 ], #use ssh? if ssh_to != "local": - encoded_cmd.extend(["ssh", ssh_to]) + encoded_cmd.extend([ "ssh", "-o", "ControlMaster=auto", "-o", "ControlPersist=600s", "-o", "ControlPath=~/.ssh/control-master-%r@%h:%p", ssh_to ]) if args.ssh_cipher: encoded_cmd.extend(["-c", args.ssh_cipher]) if args.compress: @@ -263,7 +263,7 @@ def zfs_transfer(ssh_source, source_filesystem, first_snapshot, second_snapshot, source_cmd=[] if ssh_source != "local": - source_cmd.extend([ "ssh", ssh_source ]) + source_cmd.extend([ "ssh", "-o", "ControlMaster=auto", "-o", "ControlPersist=600s", "-o", "ControlPath=~/.ssh/control-master-%r@%h:%p", ssh_source ]) if args.ssh_cipher: source_cmd.extend(["-c", args.ssh_cipher]) if args.compress: @@ -302,7 +302,7 @@ def zfs_transfer(ssh_source, source_filesystem, first_snapshot, second_snapshot, target_cmd=[] if ssh_target != "local": - target_cmd.extend([ "ssh", ssh_target ]) + target_cmd.extend([ "ssh", "-o", "ControlMaster=auto", "-o", "ControlPersist=600s", "-o", "ControlPath=~/.ssh/control-master-%r@%h:%p", ssh_target ]) if args.ssh_cipher: target_cmd.extend(["-c", args.ssh_cipher]) if args.compress: