-exclude-path never work with vzdump

SebastienLeon

New Member
Mar 2, 2016
1
0
1
52
Hi guys,

I downloaded and installed Proxmox recently, for my personal needs.
Version : pve-manager/4.1-15/8cd55b52 (running kernel: 4.2.8-1-pve)

It works great and I feel much comfortable with it :-) Congratulation for such product.
Now that my different LXC containers are running fine, I tried to use vzdump to make my backup.
To avoid to waste some space, I add some -exclude-path the same way the documentation says :

vzdump [options...] -exclude-path C</var/cache/apt/archives/.+> -exclude-path C</var/lib/apt/lists/.+>

Unfortunately, it failed miserably with this message :
bash: syntax error near unexpected token `newline'
(because bash was not happy with "<" & ">")

I add " before and after the path (that could be a nice add to your documentation). And started again :
vzdump [options...] -exclude-path "C</var/cache/apt/archives/.+>" -exclude-path "C</var/lib/apt/lists/.+>"
This time, the script runs but the archive does not excluded any of desired files.

I tried to just pass the plain paths :
vzdump [options...] -exclude-path /var/cache/apt/archives/ -exclude-path /var/lib/apt/lists/
The script runs again but the archive still contains "excluded" files.

Then I modified /etc/vzdump.conf and modified exclude-path line this way :
exclude-path: "/var/cache/apt/archives/.+" "/var/lib/apt/lists/.+"
And ran again vzdump. It failed miserably with this message :
Can't use string (""/var/cache/apt/archives/.+" "/v"...) as an ARRAY ref while "strict refs" in use at /usr/share/perl5/PVE/VZDump.pm line 581.

I tried the same replacing " by '. Same result.

I tried the same replacing " by nothing. Same result.

I modified /usr/share/perl5/PVE/VZDump.pm and commented "use strict;".
This time, the script runs but the archive still contains "excluded" files.
(note that I do not code in perl, so I didn't debug the script code itself)

Either I'm really dumb and doing some stupid thing, either the script has some regression (or the documentation is not accurate). Any idea ?

[UPDATE : I saw on the forum that someone had the same issue and a patch has been proposed. Any direct link to the fixed script file ?]