From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id C02501FF0AF for ; Fri, 06 Nov 2026 18:24:01 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id DAB77217C3; Fri, 06 Nov 2026 18:23:18 +0100 (CET) From: Christian Ebner To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup v2 26/43] client: backup writer: allow to send retain-until timestamp on backup Date: Fri, 6 Nov 2026 18:22:18 +0100 Message-ID: <20261106172235.890542-27-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261106172235.890542-1-c.ebner@proxmox.com> References: <20261106172235.890542-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: 1793985778038 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.462 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 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: JOGZU4HMRXMW25FICBMBW2ZL2VVH7PK6 X-Message-ID-Hash: JOGZU4HMRXMW25FICBMBW2ZL2VVH7PK6 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 configuration of a retain-until timestamp for the to-be created 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 + src/server/push.rs | 1 + 5 files changed, 9 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 7f7535746..0fc487fd9 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 1a254f071..bfd26897d 100644 --- a/proxmox-backup-client/src/main.rs +++ b/proxmox-backup-client/src/main.rs @@ -1054,6 +1054,7 @@ async fn create_backup( debug: true, benchmark: false, no_cache, + retain_until: None, }, ) .await?; diff --git a/src/server/push.rs b/src/server/push.rs index c99975a2b..054ace8b4 100644 --- a/src/server/push.rs +++ b/src/server/push.rs @@ -1146,6 +1146,7 @@ pub(crate) async fn push_snapshot( debug: false, benchmark: false, no_cache: false, + retain_until: None, }, ) .await -- 2.47.3