From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 6B7D87221D for ; Mon, 24 May 2021 18:01:31 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 4E6F5244F7 for ; Mon, 24 May 2021 18:01:01 +0200 (CEST) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 14B94244E1 for ; Mon, 24 May 2021 18:01:00 +0200 (CEST) Received: by mail-qv1-xf2a.google.com with SMTP id e8so11155544qvp.7 for ; Mon, 24 May 2021 09:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=aelGLAlfCo0NihmAeDJph4m8agGuKFjbB+92Q2SLmYs=; b=mmcviVwmf9gcYgsFJ5/uNXpeBgZP34J89bo6J5Se2OTO0sBEPMqhDm64EP0eFVtvxc cN+CGqwYbN0EARrgsGznxXCZFGA9vPwLIHBQyglDkgRZK/MlDD5wv+vZhkxM4jNaQJVl ZKbGSgWglpJek/1uNP5uqZVfvJCQ2JYjROtQRv+B3w4kR0ooAXf2YoM1lkD2LTJ9wR5b +4+ZKvN/mivofEaFEEiTGAntrGnygfujjsvCMgBB6hUkPfHtHaf1h9KIdidVQLmzdRSD be2loGehQkxFwnvZ9KSmtYTtiXV8KITiYMgadBZKw+3Nx7U2aKUv9xnVfrlML9CbR7q+ d2NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=aelGLAlfCo0NihmAeDJph4m8agGuKFjbB+92Q2SLmYs=; b=rTw4Oqeji6d/mOtvLHvz9hmSfB7RTp8B02wgcMjBRUrfv05QDiEsCSc6yFN2CUwSdV HFUtfdzol7ufKb3t9jfLi4PzECBYg48DPTujX7shY3rX1FeZzrwE/pHXCnLJYtUYelPp kOF+2wVICYKzlXVUCLy51hN6XLT3gt2xclhaSRWsIsxRPDWZquM7aLYjL2utn/VXbJjk YeNJOiwxHjJI0X2RRbvwC7vWiVou/E3CkXpJ2qdNiCm67tby8FK2+PQwFfKMxlUMPM9U ZxLKWAq3kGCo8zBzVFCU8dbY4s21Te3j5pdLqbJ9xzj7fu5UlYQApxI+4g+S+0tyjipj w4aA== X-Gm-Message-State: AOAM53116/5k1Qi4aLD0xR4vkoB8w1eYFil1uf9wJRU3oniS5G6Pigeh 5TVdI2Lxj+9aPDIZfF4y8TjBKKHGhtnZ0ECTtd3dawlK6+23Tg== X-Google-Smtp-Source: ABdhPJxfEACNr1483+VmhCkcRVf9csM8/dpSGPBAZTPbDd39YmE2CRnofk62WyQbwymQbF0+2bCB9V/SqvEoLLbmkA8= X-Received: by 2002:a0c:f8d1:: with SMTP id h17mr20251085qvo.2.1621872052305; Mon, 24 May 2021 09:00:52 -0700 (PDT) MIME-Version: 1.0 References: <20210511125955.25105-1-f.ebner@proxmox.com> <20210511125955.25105-7-f.ebner@proxmox.com> In-Reply-To: <20210511125955.25105-7-f.ebner@proxmox.com> From: Bruce Wainer Date: Mon, 24 May 2021 12:00:42 -0400 Message-ID: To: Proxmox VE development discussion X-SPAM-LEVEL: Spam detection results: 0 AWL -0.050 Adjusted score from AWL reputation of From: address DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain FREEMAIL_FROM 0.001 Sender email is commonly abused enduser mail provider HTML_MESSAGE 0.001 HTML included in message POISEN_SPAM_PILL_4 0.1 random spam to be learned in bayes RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [pve-devel] [PATCH zsync 6/6] fix #3351: allow keeping a different number of snapshots on source and destination X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2021 16:01:31 -0000 Hello Fabian, Since this is a series of patches, could you provide the full pve-zsync file with all the patches? It would be easier for me to test it this way. Thank you, Bruce On Tue, May 11, 2021 at 9:00 AM Fabian Ebner wrote: > by introducing a new dest-maxsnap parameter which can be used to override > maxsnap for the destination side. > > This is useful for backups, as one can potentially save a lot of space on > the > source side (or the destination side if one can come up with a use case for > that) by keeping fewer snapshots around. > > Signed-off-by: Fabian Ebner > --- > pve-zsync | 25 +++++++++++++++++++++++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/pve-zsync b/pve-zsync > index 1213361..39ead0d 100755 > --- a/pve-zsync > +++ b/pve-zsync > @@ -244,6 +244,7 @@ sub parse_argv { > verbose => undef, > limit => undef, > maxsnap => undef, > + dest_maxsnap => undef, > name => undef, > skip => undef, > method => undef, > @@ -261,6 +262,7 @@ sub parse_argv { > 'verbose' => \$param->{verbose}, > 'limit=i' => \$param->{limit}, > 'maxsnap=i' => \$param->{maxsnap}, > + 'dest-maxsnap=i' => \$param->{dest_maxsnap}, > 'name=s' => \$param->{name}, > 'skip' => \$param->{skip}, > 'method=s' => \$param->{method}, > @@ -336,6 +338,7 @@ sub param_to_job { > $job->{method} = "ssh" if !$job->{method}; > $job->{limit} = $param->{limit}; > $job->{maxsnap} = $param->{maxsnap}; > + $job->{dest_maxsnap} = $param->{dest_maxsnap}; > $job->{source} = $param->{source}; > $job->{source_user} = $param->{source_user}; > $job->{dest_user} = $param->{dest_user}; > @@ -460,6 +463,7 @@ sub format_job { > $text .= " root"; > $text .= " $PROGNAME sync --source $job->{source} --dest > $job->{dest}"; > $text .= " --name $job->{name} --maxsnap $job->{maxsnap}"; > + $text .= " --dest-maxsnap $job->{dest_maxsnap}" if > defined($job->{dest_maxsnap}); > $text .= " --limit $job->{limit}" if $job->{limit}; > $text .= " --method $job->{method}"; > $text .= " --verbose" if $job->{verbose}; > @@ -681,20 +685,31 @@ sub sync { > > ($dest->{old_snap}, $dest->{last_snap}) = snapshot_get( > $dest_dataset, > - $param->{maxsnap}, > + $param->{dest_maxsnap} // $param->{maxsnap}, > $param->{name}, > $dest->{ip}, > $param->{dest_user}, > ); > > + ($source->{old_snap}) = snapshot_get( > + $source->{all}, > + $param->{maxsnap}, > + $param->{name}, > + $source->{ip}, > + $param->{source_user}, > + ); > + > prepare_prepended_target($source, $dest, $param->{dest_user}) > if defined($dest->{prepend}); > > snapshot_add($source, $dest, $param->{name}, $date, > $param->{source_user}, $param->{dest_user}); > > send_image($source, $dest, $param); > > - for my $old_snap (@{$dest->{old_snap}}) { > + for my $old_snap (@{$source->{old_snap}}) { > snapshot_destroy($source->{all}, $old_snap, $source->{ip}, > $param->{source_user}); > + } > + > + for my $old_snap (@{$dest->{old_snap}}) { > snapshot_destroy($dest_dataset, $old_snap, $dest->{ip}, > $param->{dest_user}); > } > }; > @@ -1157,6 +1172,9 @@ $PROGNAME create --dest --source > [OPTIONS] > The number of snapshots to keep until older ones are > erased. > The default is 1, use 0 for unlimited. > > + --dest-maxsnap integer > + Override maxsnap for the destination dataset. > + > --name string > The name of the sync job, if not set it is default > > @@ -1197,6 +1215,9 @@ $PROGNAME sync --dest --source > [OPTIONS]\n > The number of snapshots to keep until older ones are > erased. > The default is 1, use 0 for unlimited. > > + --dest-maxsnap integer > + Override maxsnap for the destination dataset. > + > --name string > The name of the sync job, if not set it is 'default'. > It is only necessary if scheduler allready contains this > source. > -- > 2.20.1 > > > > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > >