[pve-devel] [PATCH v2 storage 1/1] Fix #318: Delete vzdump log when deleting a backup

Dominic Jaeger d.jaeger at proxmox.com
Thu Apr 4 11:38:21 CEST 2019


Signed-off-by: Dominic Jaeger <d.jaeger at proxmox.com>
---
 PVE/API2/Storage/Content.pm | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm
index e941cb6..5402096 100644
--- a/PVE/API2/Storage/Content.pm
+++ b/PVE/API2/Storage/Content.pm
@@ -307,6 +307,12 @@ __PACKAGE__->register_method ({
 	}
 
 	PVE::Storage::vdisk_free ($cfg, $volid);
+	if ($vtype eq 'backup') {
+	    my(undef, undef, $suffix) = File::Basename::fileparse($path,qr/(\.[^.]*)*/);
+	    $path =~ s/$suffix/.log/;
+	    $volid =~ s/$suffix/.log/;
+	    unlink($path) || die "unlink '$path' failed - $!\n";
+	}
 
 	return undef;
     }});
-- 
2.11.0




More information about the pve-devel mailing list