[pve-devel] [PATCH pve-container 3/7] vzdump: use --anchored on tar

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Nov 25 15:25:13 CET 2015


rsync treats --exclude as anchored when they start with
a slash which they do, and which is our desired behavior,
so we should also include --anchored for our tar command.
---
 src/PVE/VZDump/LXC.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/PVE/VZDump/LXC.pm b/src/PVE/VZDump/LXC.pm
index 1a39983..6142dc8 100644
--- a/src/PVE/VZDump/LXC.pm
+++ b/src/PVE/VZDump/LXC.pm
@@ -309,6 +309,7 @@ sub archive {
     # the second parameter gives the structure in the tar.
     push @$tar, "--directory=$tmpdir", './etc/vzdump/pct.conf';
     push @$tar, "--directory=$snapdir";
+    push @$tar, '--anchored';
     push @$tar, map { "--exclude=.$_" } @{$self->{vzdump}->{findexcl}};
 
     push @$tar, @sources;
-- 
2.1.4





More information about the pve-devel mailing list