]> git.proxmox.com Git - pve-container.git/commitdiff
restore: make sure only the first pct.conf is extracted
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 20 Oct 2015 08:31:24 +0000 (10:31 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 21 Oct 2015 06:13:35 +0000 (08:13 +0200)
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

index 463af0bc772bca99930913f3f3ed7dafd4695d67..6c02648a48459159b77a64d28d63cb703a81d142 100644 (file)
@@ -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/*';