[pve-devel] [PATCH pve-storage 2/6] PVE/Storage/PBSPlugin.pm - list_volumes: add ctime

Dietmar Maurer dietmar at proxmox.com
Wed Mar 4 11:46:18 CET 2020


Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/Storage/PBSPlugin.pm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/PVE/Storage/PBSPlugin.pm b/PVE/Storage/PBSPlugin.pm
index fcb1597..2a4c19c 100644
--- a/PVE/Storage/PBSPlugin.pm
+++ b/PVE/Storage/PBSPlugin.pm
@@ -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;
     }
-- 
2.20.1




More information about the pve-devel mailing list