From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 748B51FF0E7 for ; Thu, 13 Aug 2026 19:11:18 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 2E02D21A87; Thu, 13 Aug 2026 19:10:52 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 19/28] client: backup writer: allow to send retain-until timestamp on backup Date: Thu, 13 Aug 2026 19:09:53 +0200 Message-ID: <20260813171002.809441-20-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260813171002.809441-1-c.ebner@proxmox.com> References: <20260813171002.809441-1-c.ebner@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1786641017097 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.203 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust RDNS_NONE 1.274 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 6DTZWONKWLIKNR5QFGMJVXPDGPCRCEFB X-Message-ID-Hash: 6DTZWONKWLIKNR5QFGMJVXPDGPCRCEFB X-MailFrom: c.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Extend the client options to allow configurartion of a retain-until timestamp for the to be create backup snapshot on the PBS datastore. If the server api supports it, the timestamp will be picked up and processed. Signed-off-by: Christian Ebner --- examples/upload-speed.rs | 1 + pbs-client/src/backup_writer.rs | 5 +++++ proxmox-backup-client/src/benchmark.rs | 1 + proxmox-backup-client/src/main.rs | 1 + 4 files changed, 8 insertions(+) diff --git a/examples/upload-speed.rs b/examples/upload-speed.rs index 5a63e0f09..09a5f2042 100644 --- a/examples/upload-speed.rs +++ b/examples/upload-speed.rs @@ -27,6 +27,7 @@ async fn upload_speed() -> Result { debug: false, benchmark: true, no_cache: false, + retain_until: None, }, ) .await?; diff --git a/pbs-client/src/backup_writer.rs b/pbs-client/src/backup_writer.rs index b0b6a5133..1e32994ca 100644 --- a/pbs-client/src/backup_writer.rs +++ b/pbs-client/src/backup_writer.rs @@ -98,6 +98,8 @@ pub struct BackupWriterOptions<'a> { pub benchmark: bool, /// Skip datastore cache pub no_cache: bool, + /// Set retention timestamp for snapshot on PBS + pub retain_until: Option, } impl BackupWriter { @@ -125,6 +127,9 @@ impl BackupWriter { if writer_options.no_cache { param["no-cache"] = serde_json::to_value(writer_options.no_cache)?; } + if let Some(timestamp) = writer_options.retain_until { + param["retain-until"] = serde_json::to_value(timestamp)?; + } if !writer_options.ns.is_root() { param["ns"] = serde_json::to_value(writer_options.ns)?; diff --git a/proxmox-backup-client/src/benchmark.rs b/proxmox-backup-client/src/benchmark.rs index a937bacb9..89bc2396b 100644 --- a/proxmox-backup-client/src/benchmark.rs +++ b/proxmox-backup-client/src/benchmark.rs @@ -246,6 +246,7 @@ async fn test_upload_speed( debug: false, benchmark: true, no_cache, + retain_until: None, }, ) .await?; diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs index ab77f0bbf..c9b89368f 100644 --- a/proxmox-backup-client/src/main.rs +++ b/proxmox-backup-client/src/main.rs @@ -1046,6 +1046,7 @@ async fn create_backup( debug: true, benchmark: false, no_cache, + retain_until: None, }, ) .await?; -- 2.47.3