[pve-devel] [PATCH pve-container 2/2] restore: delete config from container after restore

Wolfgang Bumiller w.bumiller at proxmox.com
Tue Oct 20 10:31:25 CEST 2015


We don't need to leave /etc/vzdump/pct.conf or vps.conf in
the container's directory structure after using it, it only
causes the next backup to have the file twice in the
archive.
---
 src/PVE/LXC/Create.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index cd39828..a3db097 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -158,6 +158,7 @@ sub restore_and_configure {
 		next if $key eq 'digest' || $key eq 'rootfs' || $key eq 'snapshots';
 		$conf->{$key} = $oldconf->{$key} if !defined($conf->{$key});
 	    }
+	    unlink($pct_cfg_fn);
 	    
 	} elsif (-f $ovz_cfg_fn) {
 	    print "###########################################################\n";
@@ -172,6 +173,7 @@ sub restore_and_configure {
 	    foreach my $key (keys %$oldconf) {
 		$conf->{$key} = $oldconf->{$key} if !defined($conf->{$key});
 	    }
+	    unlink($ovz_cfg_fn);
 
 	} else {
 	    print "###########################################################\n";
-- 
2.1.4





More information about the pve-devel mailing list