[pve-devel] [PATCH pve-container 1/2] restore: make sure only the first pct.conf is extracted

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


When making a stop/snapshot mode backup of a container that
was already restored from a backup, its /etc/vzdump/pct.conf
file was replacing our newly created one in the archive. We
need to prevent the duplicate file from overwriting our new
one.
---
 src/PVE/LXC/Create.pm | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/PVE/LXC/Create.pm b/src/PVE/LXC/Create.pm
index 463af0b..cd39828 100644
--- a/src/PVE/LXC/Create.pm
+++ b/src/PVE/LXC/Create.pm
@@ -36,6 +36,11 @@ sub restore_archive {
     my $cmd = [@$userns_cmd, 'tar', 'xpf', $archive, '--numeric-owner', '--totals',
 	    '--sparse', '-C', $rootdir];
 
+    # skip-old-files doesn't have anything to do with time (old/new), but is
+    # simply -k (annoyingly also called --keep-old-files) without the 'treat
+    # existing files as errors' part... iow. it's bsdtar's interpretation of -k
+    # *sigh*, gnu...
+    push @$cmd, '--skip-old-files';
     push @$cmd, '--anchored';
     push @$cmd, '--exclude' , './dev/*';
 
-- 
2.1.4





More information about the pve-devel mailing list