[SOLVED] Backup and --exclude-path

Vittorio

Well-Known Member
Jul 24, 2019
79
5
48
59
Hi all

I would like to exclude some paths from a LXC backup

This is my jobs.cfg related to this LXC

Code:
vzdump: backup-df0d2766-fe89
        schedule 05:00
        compress zstd
        enabled 0
        exclude-path /media/frigate/recordings/ /media/frigate/clips/ /dev/mapper/ /dev/fuse/ /dev/shm/ /run/ /var/lib/docker/
        mailnotification always
        mode snapshot
        node new
        notes-template {{guestname}}
        prune-backups keep-last=3
        storage EXT_USB
        vmid 101

This is the result while backup

Code:
INFO: starting new backup job: vzdump 101 --all 0 --mode snapshot --storage EXT_USB --notes-template '{{guestname}}' --mailnotification always --node new --compress zstd --prune-backups 'keep-last=3' --exclude-path '/media/frigate/recordings/ /media/frigate/clips/ /dev/mapper/ /dev/fuse/ /dev/shm/ /run/ /var/lib/docker/'
INFO: Starting Backup of VM 101 (lxc)
INFO: Backup started at 2023-04-17 10:02:51
INFO: status = running
INFO: CT Name: frigate-new
INFO: including mount point rootfs ('/') in backup
INFO: excluding bind mount point mp0 ('/mnt/frigate-storage') from backup (not a volume)
INFO: backup mode: snapshot
INFO: ionice priority: 7
INFO: create storage snapshot 'vzdump'


but it stuck there.

Mainly, the huge stuff are in /media/frigate/recordings and in /var/lib/docker and both are in the exclude-path

What else can I check?

Thanks
 
Hi,
seems like your bind mount point is not included in the backup. In order to change that, set the Backup checkmark in Resources -> <mountpoint> -> Edit

Edit: Sorry I misread your post, your excludes are not related to the mountpoint. Please post the container config pct config 101 as well as the storage config cat /etc/pve/storage.cfg. Seems like taking the snapshot of you storage is taking some time?
 
Last edited:
Hi,
seems like your bind mount point is not included in the backup. In order to change that, set the Backup checkmark in Resources -> <mountpoint> -> Edit

Edit: Sorry I misread your post, your excludes are not related to the mountpoint. Please post the container config pct config 101 as well as the storage config cat /etc/pve/storage.cfg. Seems like taking the snapshot of you storage is taking some time?

Hi Chris

this is the LXC config


Code:
arch: amd64
cores: 4
description: # Docker LXC%0A  ### https://tteck.github.io/Proxmox/%0A  <a href='https://ko-fi.com/D1D7EP4GF'><img src='https://img.shields.io/badge/%E2%98%95-Buy me a coffee-red' /></a>%0Amp1%3A /media/ext_usb/frigate,mp=/mnt/frigate-ext%0Amp2%3A dati-frigate%3A101/vm-101-disk-0.raw,mp=/mnt/frigate-ext,backup=1,size=50G%0Amp1%3A /media/frigate,mp=/mnt/frigate-ext%0A
features: fuse=1,keyctl=1,nesting=1
hostname: frigate-new
memory: 1500
mp0: /mnt/pve/frigate-storage,mp=/mnt/frigate-storage
net0: name=eth0,bridge=vmbr0,gw=192.168.2.10,hwaddr=0E:FD:32:B6:3B:F0,ip=192.168.2.24/24,type=veth
onboot: 1
ostype: debian
rootfs: thinpool_sdb:vm-101-disk-0,size=75G
startup: order=4
swap: 1500
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: a
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0, 0
lxc.mount.entry: /dev/bus/usb/002/ dev/bus/usb/002/ none bind,optional,create=dir 0, 0
lxc.cap.drop:
lxc.mount.auto: cgroup:rw
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file

and this is the storage


Code:
dir: local
        path /var/lib/vz
        content vztmpl,iso,backup


lvmthin: local-lvm
        thinpool data
        vgname pve
        content rootdir,images


lvmthin: thinpool_sdb
        thinpool thinpool_sdb
        vgname thinpool_sdb
        content images,rootdir
        nodes new


dir: EXT_USB
        path /media/ext_usb/backup
        content iso,snippets,images,vztmpl,backup,rootdir
        prune-backups keep-all=1
        shared 1

And this is the result of du command

Code:
root@frigate-new:~# du -h / -d 1
872M    /usr
8.4G    /media
52M     /root
0       /sys
3.6M    /etc
du: cannot access '/proc/5786/task/5786/fd/3': No such file or directory
du: cannot access '/proc/5786/task/5786/fdinfo/3': No such file or directory
du: cannot access '/proc/5786/fd/4': No such file or directory
du: cannot access '/proc/5786/fdinfo/4': No such file or directory
4.0K    /proc
4.0K    /srv
4.0K    /boot
228K    /run
16K     /lost+found
16K     /opt
4.0K    /dev
40K     /tmp
4.4G    /var
4.0K    /home
12M     /mnt
14G     /

The big files are in /var/lib/docker and /media/frigate/recordings and I'm trying to exclude those paths

Thanks
 
Last edited:
Please note that FUSE mounts are known to cause issues for backups of type snapshot, see the corresponding section in the docs [0] and some reports in the forum [1]. Use stop mode for backup if you require the fuse feature or disable fuse.

[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pct_container_storage
[1] https://forum.proxmox.com/threads/backup-of-lxc-gets-stuck-when-it-has-fuse-mount.119748/
[2] https://forum.proxmox.com/threads/c...t-vzdump-when-doing-a-snapshot-backup.117949/
 
  • Like
Reactions: Vittorio
Please note that FUSE mounts are known to cause issues for backups of type snapshot, see the corresponding section in the docs [0] and some reports in the forum [1]. Use stop mode for backup if you require the fuse feature or disable fuse.

[0] https://pve.proxmox.com/pve-docs/pve-admin-guide.html#pct_container_storage
[1] https://forum.proxmox.com/threads/backup-of-lxc-gets-stuck-when-it-has-fuse-mount.119748/
[2] https://forum.proxmox.com/threads/c...t-vzdump-when-doing-a-snapshot-backup.117949/
Thanks Chris!

Using backup mode STOP did the trick.
 
One more thing

When I do a changes in the file /etc/pve/jobs.cfg I noticed that I have to reboot Proxmox to have it updated.

Is there any other way?
 
Hi,
One more thing

When I do a changes in the file /etc/pve/jobs.cfg I noticed that I have to reboot Proxmox to have it updated.

Is there any other way?
running systemctl reload-or-restart pvescheduler.service pveproxy.service pvedaemon.service should work too. You also don't need to do it if you change the backup job via API, e.g.
Code:
pvesh set /cluster/backup/backup-4f2f3b87-0165 --exclude-path "/one /two /three"
It's a bit more cumbersome then editing the file, but you get instant complains if you don't adhere to the expected option schema ;)
 

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!