From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH common v3 1/1] PBSClient: add 'tar' parameter to file_restore_extract
Date: Thu, 19 Oct 2023 11:13:53 +0200 [thread overview]
Message-ID: <20231019091355.2799960-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20231019091355.2799960-1-d.csapak@proxmox.com>
so that we can get a 'tar.zst' from proxmox-file-restore by giving
'--format tar --zstd' to the file-restore binary
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
src/PVE/PBSClient.pm | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm
index ec05a1c..e63af03 100644
--- a/src/PVE/PBSClient.pm
+++ b/src/PVE/PBSClient.pm
@@ -416,7 +416,7 @@ sub file_restore_extract_prepare {
# this blocks while data is transfered, call this from a background worker
sub file_restore_extract {
- my ($self, $output_file, $snapshot, $filepath, $base64) = @_;
+ my ($self, $output_file, $snapshot, $filepath, $base64, $tar) = @_;
(my $namespace, $snapshot) = split_namespaced_parameter($self, $snapshot);
@@ -430,10 +430,15 @@ sub file_restore_extract {
my $fn = fileno($fh);
my $errfunc = sub { print $_[0], "\n"; };
+ my $cmd = [ $snapshot, $filepath, "-", "--base64", $base64 ? 1 : 0];
+ if ($tar) {
+ push @$cmd, '--format', 'tar', '--zstd', 1;
+ }
+
return run_raw_client_cmd(
$self,
"extract",
- [ $snapshot, $filepath, "-", "--base64", $base64 ? 1 : 0 ],
+ $cmd,
binary => "proxmox-file-restore",
namespace => $namespace,
errfunc => $errfunc,
--
2.30.2
next prev parent reply other threads:[~2023-10-19 9:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 9:13 [pve-devel] [PATCH common/storage/widget-toolkit v3] add tar.zst download in pve Dominik Csapak
2023-10-19 9:13 ` Dominik Csapak [this message]
2023-11-06 17:34 ` [pve-devel] applied: [PATCH common v3 1/1] PBSClient: add 'tar' parameter to file_restore_extract Thomas Lamprecht
2023-10-19 9:13 ` [pve-devel] [PATCH storage v3 1/1] api/filerestore: add 'tar' parameter to 'download' api Dominik Csapak
2023-11-13 15:45 ` [pve-devel] applied: " Thomas Lamprecht
2023-10-19 9:13 ` [pve-devel] [PATCH widget-toolkit v3 1/1] window/FileBrowser: enable tar button by default Dominik Csapak
2023-11-13 15:46 ` [pve-devel] applied: " Thomas Lamprecht
2023-11-13 15:46 ` [pve-devel] " Thomas Lamprecht
2023-11-13 15:48 ` Dominik Csapak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231019091355.2799960-2-d.csapak@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal