[SOLVED] Backup Client --exclude "--include"??

Mar 7, 2024
2
0
1
Hi all,
i have the following problem. I want to backup some folders on my linux servers, fopr example:

/etc/somepackage/*
/srv/sometool/config/*
/srv/sometool/data/*
/opt/backups/*

it is important to have the absolute paths preserved in the backup.
the usage of .pxarexclude files is no option, cause i have multiple backups jobs with different file sets

anyone an idea?

thanks a lot
Stefan
 
i got it, maybe some of you need this.

This snippet wil backup the following folders while preserving the absolute paths

Code:
/etc/compose-files/my-project/*
/srv/test/data/*

Bash:
proxmox-backup-client backup --backup-type host \
        backup-test.pxar:/ \
        --exclude=/* \
        --exclude=!/srv \
        --exclude=/srv/* \
        --exclude=!/srv/test \
        --exclude=/srv/test/* \
        --exclude=!/srv/test/data \
        --exclude=!/etc \
        --exclude=/etc/* \
        --exclude=!/etc/compose-files \
        --exclude=/etc/compose-files/* \
        --exclude=!/etc/compose-files/my-project \
        --repository MyUser@pbs@MyPBServer:MyStore \
        --ns MySubNameSpace

the order is important!!!

  1. Backup complete /
  2. Exclude all /*
  3. include next folder !/srv
  4. exclude all inside /srv/*
  5. include next folder !/srv/test
  6. and so on, till target folder(s)
repeat for each additional needed folder

hope this helps...
 
Last edited: