Backup plugin - how to exclude directories with FSArchiver?

  • I'm having a problem excluding directories, but only if run from backup plugin :)

    Got the same behaviour for any directory.

    Just for test, excluded /var/lib, that is about half the size of root fs.

    Default fsarchiver settings, just added --exclude='/var/lib'

    From backup plugin UI, manual run:


    Obviously it is still compressing /var/lib and all contents.

    Check the filesize - almost 4 GB:

    Code
    ls -lh *.fsa
    -rw-r--r-- 1 root users 3,9G lip  19 09:47 backup-omv-2025-06-19_09-46-55.fsa


    This is a running backup process, seems ok, extra exclude option is appended:

    Code
    ps -ef | grep fsarch
    root       23115   22949 99 09:46 ?        00:00:07 fsarchiver savefs -o /srv/dev-disk-by-uuid-3067b496-644d-4574-9ac7-5fda7a0276f4/backup_omv/omvbackup/backup-omv-2025-06-19_09-46-55.fsa /dev/sda1 -v -A -Z 2 -j 4 --exclude='/var/lib'


    Now, manual run as root via ssh, same cmd from above, just changed archive name:

    Code
    fsarchiver savefs -o /srv/dev-disk-by-uuid-3067b496-644d-4574-9ac7-5fda7a0276f4/backup_omv/omvbackup/backup-omv-2025-06-19_manual_run.fsa /dev/sda1 -v -A -Z 2 -j 4 --exclude='/var/lib'

    This time directory is excluded as expected.

    Final archive sizes, notice how manual run with the same command is amost half the size.

    Code
    ls -lh *.fsa
    -rw-r--r-- 1 root users 3,9G lip  19 09:47 backup-omv-2025-06-19_09-46-55.fsa
    -rw-r--r-- 1 root users 2,2G lip  19 10:32 backup-omv-2025-06-19_manual_run.fsa


    Any ideas ?

    How to exclude some directory from backup?


    FSArchiver - Quick Start guide

  • crashtest

    Approved the thread.
    • New
    • Official Post

    If the same command works when run manually, I'm not sure what I could change on the plugin to make it work. Are you seeing this problem when the scheduled job runs or just when you click the Run button in the plugin? Either way, they are just running the /usr/sbin/omv-backup script.


    What kind of system? I do recommend not putting docker storage on the OS drive though. You really don't want to exclude /var/lib completely from the backup.

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Same problem with scheduled task and any excluded dir.

    As i wrote in the first post, /var/lib was chosen just for test because it's large and easy to spot in the output of fsarchiver.

    New info: if I run the script as root (/usr/sbin/omv-backup) it also does not exclude directory.

    Now it gets interesting...


    Setting exclude like this in settings doesn't work for me from scheduler or direct call of /usr/sbin/omv-backup:

    --exclude='/some/directory'


    But it works without the quotes :)

    --exclude=/some/directory


    The same principle for dir content: /some/directory/* works fine, but with quotes it does not.


    Well, at least I can exclude dirs now :)

    Enough testing... back to good old dd backup :)

    • New
    • Official Post

    When called from the script, it is literally passing the quotes as part of the search string. fsarchiver is not doing expansion on that string. So it is doing an exact search including the quotes. I didn't remember this issue but I guess that is why the exclude field hint shows paths without quotes.

    omv 7.7.10-1 sandworm | 64 bit | 6.11 proxmox kernel

    plugins :: omvextrasorg 7.0.2 | kvm 7.1.8 | compose 7.6.10 | cterm 7.8.7 | cputemp 7.0.2 | mergerfs 7.0.5 | scripts 7.3.1


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • csh123

    Added the Label resolved
  • csh123

    Added the Label OMV 7.x

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!