[pve-devel] [PATCH 1/2] Add ssh BatchMode.

Wolfgang Link w.link at proxmox.com
Tue Aug 2 12:24:49 CEST 2016


In case of connection lost the ssh keeps the zfs receive running and it is not possible to make a new sync.
---
 pve-zsync | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pve-zsync b/pve-zsync
index 16528ac..f40971c 100644
--- a/pve-zsync
+++ b/pve-zsync
@@ -881,7 +881,7 @@ sub send_image {
 
     my $cmd = [];
 
-    push @$cmd, 'ssh', "root\@$source->{ip}", '--' if $source->{ip};
+    push @$cmd, 'ssh', '-o', 'BatchMode=yes', "root\@$source->{ip}", '--' if $source->{ip};
     push @$cmd, 'zfs', 'send';
     push @$cmd, '-v' if $param->{verbose};
 
@@ -898,7 +898,7 @@ sub send_image {
     $target =~ s!/+!/!g;
 
     push @$cmd, \'|';
-	push @$cmd, 'ssh', "root\@$dest->{ip}", '--' if $dest->{ip};
+	push @$cmd, 'ssh', '-o', 'BatchMode=yes', "root\@$dest->{ip}", '--' if $dest->{ip};
 	push @$cmd, 'zfs', 'recv', '-F', '--';
 	push @$cmd, "$target";
 
-- 
2.1.4





More information about the pve-devel mailing list