PBS Plugin: list_volumes: add ctime

Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
Dietmar Maurer
2020-03-04 11:46:18 +01:00
committed by Thomas Lamprecht
parent 9c629b3e76
commit 545e127e52

View File

@ -282,18 +282,21 @@ sub list_volumes {
foreach my $item (@$data) {
my $btype = $item->{"backup-type"};
my $bid = $item->{"backup-id"};
my $btime = $item->{"backup-time"};
my $epoch = $item->{"backup-time"};
my $size = $item->{size} // 1;
next if !($btype eq 'vm' || $btype eq 'ct');
next if $bid !~ m/^\d+$/;
$btime = strftime("%FT%TZ", gmtime($btime));
my $btime = strftime("%FT%TZ", gmtime($epoch));
my $volname = "backup/${btype}/${bid}/${btime}";
my $volid = "$storeid:$volname";
my $info = { volid => $volid , format => "pbs-$btype", size => $size, content => 'backup', vmid => int($bid) };
my $info = {
volid => $volid , format => "pbs-$btype", size => $size,
content => 'backup', vmid => int($bid), ctime => $epoch
};
push @$res, $info;
}