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

Dominic Jaeger d.jaeger at proxmox.com
Wed Apr 3 12:27:28 CEST 2019


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

diff --git a/PVE/API2/Storage/Content.pm b/PVE/API2/Storage/Content.pm
index e941cb6..cbee77d 100644
--- a/PVE/API2/Storage/Content.pm
+++ b/PVE/API2/Storage/Content.pm
@@ -308,6 +308,11 @@ __PACKAGE__->register_method ({
 
 	PVE::Storage::vdisk_free ($cfg, $volid);
 
+	# Delete not only image but also logfile
+	my $logpath = substr $path, 0, index($path, '.');
+	$logpath = "$logpath.log";
+	unlink($logpath) || die "unlink '$logpath' failed - $!\n";
+
 	return undef;
     }});
 
-- 
2.11.0




More information about the pve-devel mailing list