]> git.proxmox.com Git - pve-storage.git/commitdiff
Fix #318: Delete vzdump log when deleting a backup
authorDominic Jäger <d.jaeger@proxmox.com>
Tue, 9 Apr 2019 07:41:25 +0000 (09:41 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 10 Apr 2019 08:10:44 +0000 (10:10 +0200)
Vzdump log files were not deleted when a backup was deleted.
Consequently, the folder continuously filled with .log files.
Now they get deleted after the backup is removed.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
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;
     }});