vzdump exclude-path pattern match or anchored to start?

robm

Member
Jan 9, 2020
19
1
8
51
When using exclude-path in /etc/vzdump.conf, does an entry such as:
"/tmp/?*"
only match /tmp/abc, or would it also match /home/xyz/tmp/abc?

If we want to match directories like "/home/abc/www/var/report" and "/home/def/www/var/report" would this be the right syntax:
"?*/var/report/?*"

Thanks for any pointers on the various ways to match full directory paths, and then multiple relative ones.
 
If the pattern starts with a / then it is anchored to a particular spot in the hierarchy of files, otherwise it is matched against the end of the pathname.

See the "Include/Exclude Pattern Rules" section from https://linux.die.net/man/1/rsync for details about the pattern rules.

If we want to match directories like "/home/abc/www/var/report" and "/home/def/www/var/report" would this be the right syntax:
"?*/var/report/?*"

actually the following pattern should be enough: **/var/report/ This makes use of two rules:
* use ’**’ to match anything, including slashes.
* if the pattern ends with a / then it will only match a directory, not a regular file, symlink, or device

You do not need the glob afterwards, as specifying the directory will exclude all childs automatically, i.e., excludes are greedy.
The one in front was wrong, ** can be used to match any path (including slashes), ?* won't do that.
 

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!