-exclude-path never work with vzdump

SebastienLeon

New Member
Mar 2, 2016
1
0
1
50
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 ?]
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!