]> git.proxmox.com Git - pve-storage.git/blobdiff - PVE/API2/Storage/Content.pm
Fix #318: Delete vzdump log when deleting a backup
[pve-storage.git] / PVE / API2 / Storage / Content.pm
index e941cb653ca8bb1d60ffadad5c9d22f508f42275..4aa9daf840203d0d78c69736b65108e83f387f4d 100644 (file)
@@ -307,6 +307,13 @@ __PACKAGE__->register_method ({
        }
 
        PVE::Storage::vdisk_free ($cfg, $volid);
+       if ($vtype eq 'backup' && $path =~
+           /(.*\/vzdump-\w+-\d+-\d{4}_\d{2}_\d{2}-\d{2}_\d{2}_\d{2})[^\/]+$/) {
+           my $logpath = "$1.log";
+           if (-e $logpath) {
+               unlink($logpath);
+           }
+       }
 
        return undef;
     }});