]> git.proxmox.com Git - pve-zsync.git/commitdiff
Fix: You can now use the pool as replication source.
authorWolfgang Link <w.link@proxmox.com>
Fri, 17 Nov 2017 12:34:57 +0000 (13:34 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 21 Mar 2018 12:53:24 +0000 (13:53 +0100)
In previous version you need a dataset as replication source.

pve-zsync

index 2503117235bbc5bb3540ba69147aa33c77faf63d..e411dff031c3f3f78e091a517835696875ebe9d4 100644 (file)
--- a/pve-zsync
+++ b/pve-zsync
@@ -860,7 +860,8 @@ sub snapshot_destroy {
     if ($dest) {
        my @ssh = $dest->{ip} ? ('ssh', "root\@$dest->{ip}", '--') : ();
 
-       my $path = "$dest->{all}\/$source->{last_part}";
+       my $path = "$dest->{all}";
+       $path .= "/$source->{last_part}" if $source->{last_part};
 
        eval {
            run_cmd([@ssh, @zfscmd, "$path\@$snap"]);
@@ -877,7 +878,13 @@ sub snapshot_exist {
     my $cmd = [];
     push @$cmd, 'ssh', "root\@$dest->{ip}", '--' if $dest->{ip};
     push @$cmd, 'zfs', 'list', '-rt', 'snapshot', '-Ho', 'name';
-    push @$cmd, "$dest->{all}/$source->{last_part}\@$source->{old_snap}";
+
+    my $path = $dest->{all};
+    $path .= "/$source->{last_part}" if $source->{last_part};
+    $path .= "\@$source->{old_snap}";
+
+    push @$cmd, $path;
+
 
     my $text = "";
     eval {$text =run_cmd($cmd);};
@@ -910,7 +917,8 @@ sub send_image {
        my $bwl = $param->{limit}*1024;
        push @$cmd, \'|', 'cstream', '-t', $bwl;
     }
-    my $target = "$dest->{all}/$source->{last_part}";
+    my $target = "$dest->{all}";
+    $target .= "/$source->{last_part}" if $source->{last_part};
     $target =~ s!/+!/!g;
 
     push @$cmd, \'|';