[pve-devel] [zsync] fix: check for incremental sync snapshot.

Dietmar Maurer dietmar at proxmox.com
Wed Mar 18 08:02:45 CET 2020


Why does the patch ignore the output from the command?

> On March 18, 2020 7:51 AM Wolfgang Link <w.link at proxmox.com> wrote:
> 
>  
> For an incremental sync you need the last_snap on both sides.
> ---
>  pve-zsync | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/pve-zsync b/pve-zsync
> index ea3178e..893baf0 100755
> --- a/pve-zsync
> +++ b/pve-zsync
> @@ -931,6 +931,7 @@ sub snapshot_destroy {
>      }
>  }
>  
> +# check if snapshot for incremental sync exist on dest side
>  sub snapshot_exist {
>      my ($source , $dest, $method, $dest_user) = @_;
>  
> @@ -940,22 +941,16 @@ sub snapshot_exist {
>  
>      my $path = $dest->{all};
>      $path .= "/$source->{last_part}" if $source->{last_part};
> -    $path .= "\@$source->{old_snap}";
> +    $path .= "\@$source->{last_snap}";
>  
>      push @$cmd, $path;
>  
> -
> -    my $text = "";
> -    eval {$text =run_cmd($cmd);};
> +    eval {run_cmd($cmd)};
>      if (my $erro =$@) {
>  	warn "WARN: $erro";
>  	return undef;
>      }
> -
> -    while ($text && $text =~ s/^(.*?)(\n|$)//) {
> -	my $line =$1;
> -	return 1 if $line =~ m/^.*$source->{old_snap}$/;
> -    }
> +    return 1;
>  }
>  
>  sub send_image {
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pve-devel mailing list
> pve-devel at pve.proxmox.com
> https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel




More information about the pve-devel mailing list