Include/exclude files in proxmox-backup-client

stefano.cailotto

New Member
Dec 6, 2024
3
0
1
Hello,
I'm trying to switch my backup system (based mainly on backupninja and custom scripts) to proxmox-backup-client.
I wrote a small script to run backups, using the repeated --exclude flag not to backup unneeded data.
Comparing the size of previously backed-up data, I see a big discrepancy of backup size, so my question is: how are the --exclude flags treated, globally or per path/pxar file?
E.g. if I want to backup /etc and /root into 2 different archives, and I add the --exclude foo to the path, is it considered for both /etc/foo and /root/foo or only for the first path preceding it?

BR,
Stefano
 
Hi,
Comparing the size of previously backed-up data, I see a big discrepancy of backup size, so my question is: how are the --exclude flags treated, globally or per path/pxar file?
the exclude patterns apply to all the pxar archives you create with the command invocation. What discrepancy do you see?

E.g. if I want to backup /etc and /root into 2 different archives, and I add the --exclude foo to the path, is it considered for both /etc/foo and /root/foo or only for the first path preceding it?
Note that this will exclude any file/folder named foo, not just at the archive root. You might want to anchor the pattern, e.g. by /foo if you create your archive via proxmox-backup-client backup root.pxar:/root etc.pxar:/etc --exclude=/foo
 
Hi,

the exclude patterns apply to all the pxar archives you create with the command invocation. What discrepancy do you see?


Note that this will exclude any file/folder named foo, not just at the archive root. You might want to anchor the pattern, e.g. by /foo if you create your archive via proxmox-backup-client backup root.pxar:/root etc.pxar:/etc --exclude=/foo
The discrepancy I see is that the proxmox based backup (with the - hopefully - same include/exclude patterns ) is 3 times bigger than the backupninja based one.
It's clear that pattern exclusion, as I thought
 
You could dump the content for a snapshot via proxmox-backup-client catalog dump <snapshot> and compare that to the list of contents you expect, maybe that gives you a clue what else is included in the backup which you do not expect.
 
Hello, maybe this will help someone!

I'm using proxmox-backup-client to backup the pve server-1 host. It works with file exclusions!

To exclude files from the /var/lib /var/lib/vz /var/lib/apt /var/lib/dpkg directories, you need to add the -exclude /apt -exclude /dpkg -exclude /vz part of the path, since we've already specified the full path here: var_lib.pxar:/var/lib.

The most important thing is to add the exclusions after the var_lib.pxar:/var/lib archive definition.
My example is below.

server-1#proxmox-backup-client backup var_lib.pxar:/var/lib -exclude /apt -exclude /dpkg -exclude /vz etc.pxar:/etc home.pxar:/home root.pxar:/root --repository 192.168.x.x:Store-PBClient

Best regards!
VladBT