From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id D94281FF185 for ; Mon, 21 Jul 2025 18:44:27 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 55ED415E15; Mon, 21 Jul 2025 18:45:31 +0200 (CEST) From: Christian Ebner To: pbs-devel@lists.proxmox.com Date: Mon, 21 Jul 2025 18:44:33 +0200 Message-ID: <20250721164507.1045869-16-c.ebner@proxmox.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250721164507.1045869-1-c.ebner@proxmox.com> References: <20250721164507.1045869-1-c.ebner@proxmox.com> MIME-Version: 1.0 X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1753116306994 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.045 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v10 12/46] api: datastore: conditionally upload client log to s3 backend X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" If the datastore is backed by an s3 compatible object store, upload the client log content to the s3 backend before persisting it to the local cache store. Signed-off-by: Christian Ebner --- changes since version 9: - no changes src/api2/admin/datastore.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/api2/admin/datastore.rs b/src/api2/admin/datastore.rs index 1fabda09a..e6b8449d2 100644 --- a/src/api2/admin/datastore.rs +++ b/src/api2/admin/datastore.rs @@ -1637,6 +1637,17 @@ pub fn upload_backup_log( // always verify blob/CRC at server side let blob = DataBlob::load_from_reader(&mut &data[..])?; + if let DatastoreBackend::S3(s3_client) = datastore.backend()? { + let object_key = pbs_datastore::s3::object_key_from_path( + &backup_dir.relative_path(), + file_name.as_ref(), + ) + .context("invalid client log object key")?; + let data = hyper::body::Bytes::copy_from_slice(blob.raw_data()); + proxmox_async::runtime::block_on(s3_client.upload_replace_with_retry(object_key, data)) + .context("failed to upload client log to s3 backend")?; + }; + replace_file(&path, blob.raw_data(), CreateOptions::new(), false)?; // fixme: use correct formatter -- 2.47.2 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel