From: Thomas Lamprecht Date: Tue, 17 Nov 2020 12:04:53 +0000 (+0100) Subject: PBS client: backup tree: avoid over generic param has X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=6674eb1e3d8f449de44b0f8fe3bc864935790349 PBS client: backup tree: avoid over generic param has Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index 75b3b50..44e3176 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -212,27 +212,24 @@ sub get_snapshots { return run_client_cmd($self, "snapshots", $param); }; -sub backup_tree { - my ($self, $opts) = @_; +# create a new PXAR backup of a FS directory tree - doesn't cross FS boundary +# by default. +sub backup_fs_tree { + my ($self, $root, $id, $pxarname, $cmd_opts) = @_; - my $type = delete $opts->{type}; - die "backup-type not provided\n" if !defined($type); - my $id = delete $opts->{id}; die "backup-id not provided\n" if !defined($id); - my $root = delete $opts->{root}; - die "root dir not provided\n" if !defined($root); - my $pxarname = delete $opts->{pxarname}; + die "backup root dir not provided\n" if !defined($root); die "archive name not provided\n" if !defined($pxarname); - my $time = delete $opts->{time}; my $param = [ "$pxarname.pxar:$root", - '--backup-type', $type, + '--backup-type', 'host', '--backup-id', $id, ]; - push @$param, '--backup-time', $time if defined($time); - return run_raw_client_cmd($self, 'backup', $param, %$opts); + $cmd_opts //= {}; + + return run_raw_client_cmd($self, 'backup', $param, %$cmd_opts); }; sub restore_pxar {