Possible to manually exclude directories from LXC backups?

DougD

Member
Jun 12, 2019
8
7
23
44
I have a container that uses rclone to mount Google Drive as a filesystem. I need to find a way to exclude this mount point from the PVE backup, similar to how host directory mount points are excluded. Is this possible?

Edit: I realize this is possible with the manual command-line backup tool. I want to know if this is possible for the automated container backup system PVE uses, like maybe something that can be added to the container config file?
 
Last edited:
Edit: I realize this is possible with the manual command-line backup tool. I want to know if this is possible for the automated container backup system PVE uses, like maybe something that can be added to the container config file?

It could be better integrated, yeah, but it can be workarounded now already:
The cluster wide backup jobs are also only calls to vzdump, they reside in /etc/pve/vzdump.cron.

You can open that file in an editor, locate your respective job and add the "exclude-path ..." arguments you need. Then it should do as you wish, re-editing should keep those manual added arguments, but not 100% sure from top of my head.

EDIT: since Proxmox VE 7.1 new backup jobs are managed by the /etc/pve/jobs.cfg config, see the post below for details.
 
Last edited:
Thanks much!

I have now tested this, and the manual exclusions I made have been retained even after modifying the backup settings from the UI.
 
No plans for that currently.

What could be done is exposing the exclude-path option in the web-interface for the backup job edit window.
If you'd like that then feel free to open an enhancement request over at https://bugzilla.proxmox.com/
 
  • Like
Reactions: reub and Master64
A workaround for people with the same problems:
Just make a new mount-point with a very small size (0.001GB) and mount it into /mnt.
Don't forget to unselect the "backup" feature of that mount-point.
Then use rclone to mount into a subdirectory of /mnt like /mnt/Gcloud.

1665176056601.png
 
  • Like
Reactions: faviann and scyta
It could be better integrated, yeah, but it can be workarounded now already:
The cluster wide backup jobs are also only calls to vzdump, the reside in /etc/pve/vzdump.cron.
You can open that file in an editor, locate your respective job and add the "exclude-path ..." arguments you need. Then it should do as you wish, re-editing should keep those manual added args, but not 100% sure from top of my head.

My copy of /etc/pve/vzdump.cron doesn't have any containers/VMs info in it. It is almost blank. I'm on PVE 7.4-17

How did you specify the exclusion? Can you show what's in that file?
 
My copy of /etc/pve/vzdump.cron doesn't have any containers/VMs info in it. It is almost blank. I'm on PVE 7.4-17

How did you specify the exclusion? Can you show what's in that file?
Proxmox VE 7.1 switched from using CRON jobs to a separate scheduler that uses the more flexible calendar event format like previously already used by the replication stack and also Proxmox Backup Server jobs.

The configuration file for that new scheduled job system is located under /etc/pve/jobs.cfg and any new backup job will be saved to that file.

To add paths that should be excluded to a job you can use the exclude-path property. That property takes a single path but can be added multiple times.

A job entry snippet from that config, with two excluded path entries would then look something like this:

Code:
vzdump: backup-00cbea01-9f67
    comment testing exclude-path additions
    schedule sun 01:00
    compress zstd
    enabled 1
    exclude-path /foo/bar
    exclude-path /baz
    mode snapshot
    storage backups
    vmid 102,103,133,118,125,1890,1110,154,105
 
  • Like
Reactions: Motik
Proxmox VE 7.1 switched from using CRON jobs to a separate scheduler that uses the more flexible calendar event format like previously already used by the replication stack and also Proxmox Backup Server jobs.

The configuration file for that new scheduled job system is located under /etc/pve/jobs.cfg and any new backup job will be saved to that file.

To add paths that should be excluded to a job you can use the exclude-path property. That property takes a single path but can be added multiple times.

A job entry snippet from that config, with two excluded path entries would then look something like this:

Code:
vzdump: backup-00cbea01-9f67
    comment testing exclude-path additions
    schedule sun 01:00
    compress zstd
    enabled 1
    exclude-path /foo/bar
    exclude-path /baz
    mode snapshot
    storage backups
    vmid 102,103,133,118,125,1890,1110,154,105
Sorry for the resurrection... if this jobs.cfg is for multiple lxc hosts will it exclude /foo/bar in every single lxc backup? Is there a way to specify by LXC what you want to exclude?
 

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!