]> git.proxmox.com Git - pve-zsync.git/commitdiff
Revert "fix: check for incremental sync snapshot."
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 19 Mar 2020 12:02:02 +0000 (13:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 19 Mar 2020 12:02:02 +0000 (13:02 +0100)
This reverts commit 723623e8850f0f78cfce6d0c123c68b621184a71.

pve-zsync

index 347866afb36e3bf5365869e318e3e8895fc1dfe6..25add923165a29f4c8d4e896d6ffd408bf720cb4 100755 (executable)
--- a/pve-zsync
+++ b/pve-zsync
@@ -933,7 +933,6 @@ sub snapshot_destroy {
     }
 }
 
-# check if snapshot for incremental sync exist on dest side
 sub snapshot_exist {
     my ($source , $dest, $method, $dest_user) = @_;
 
@@ -943,16 +942,22 @@ sub snapshot_exist {
 
     my $path = $dest->{all};
     $path .= "/$source->{last_part}" if $source->{last_part};
-    $path .= "\@$source->{last_snap}";
+    $path .= "\@$source->{old_snap}";
 
     push @$cmd, $path;
 
-    eval {run_cmd($cmd)};
+
+    my $text = "";
+    eval {$text =run_cmd($cmd);};
     if (my $erro =$@) {
        warn "WARN: $erro";
        return undef;
     }
-    return 1;
+
+    while ($text && $text =~ s/^(.*?)(\n|$)//) {
+       my $line =$1;
+       return 1 if $line =~ m/^.*$source->{old_snap}$/;
+    }
 }
 
 sub send_image {