X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=blobdiff_plain;f=src%2FPVE%2FPBSClient.pm;h=44e31764ef4d803a10cfe975f8e27c5d2d82ccce;hp=a108e6f9692fe61383de35b024157640ca376945;hb=6674eb1e3d8f449de44b0f8fe3bc864935790349;hpb=69a3a5858fb8225b4b314307c598df13d0c48c51 diff --git a/src/PVE/PBSClient.pm b/src/PVE/PBSClient.pm index a108e6f..44e3176 100644 --- a/src/PVE/PBSClient.pm +++ b/src/PVE/PBSClient.pm @@ -202,36 +202,34 @@ sub autogen_encryption_key { return file_get_contents($encfile); }; +# lists all snapshots, optionally limited to a specific group sub get_snapshots { - my ($self, $opts) = @_; + my ($self, $group) = @_; my $param = []; - push @$param, $opts->{group} if defined($opts->{group}); + push @$param, $group if defined($group); 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 {