Support for excluding backup dirs
This commit is contained in:
parent
2593340346
commit
696032b568
@ -17,6 +17,12 @@
|
||||
mode: "0400"
|
||||
changed_when: "true" # we always want ti give roles a chance to register dirs
|
||||
|
||||
- name: create the /backup-dirs-exclude file
|
||||
file:
|
||||
path: "/backup-dirs-exlude"
|
||||
state: "touch"
|
||||
mode: "0400"
|
||||
|
||||
- name: Ensure file contains lines from array # this also runs on main in case someone doesn't run the backup.yml
|
||||
lineinfile:
|
||||
path: /backup-dirs
|
||||
|
||||
@ -8,7 +8,10 @@ $RESTIC --password-file=$PWD_FILE unlock
|
||||
date
|
||||
echo "Sending the backup to the destination..."
|
||||
|
||||
cat /backup-dirs | xargs -d '\n' $RESTIC --password-file=$PWD_FILE backup
|
||||
{
|
||||
cat /backup-dirs
|
||||
sed -e '/^$/d' -e 's|^|--exclude=|' /backup-dirs-exclude
|
||||
} | xargs -d '\n' $RESTIC --password-file=$PWD_FILE backup
|
||||
|
||||
date
|
||||
echo "Pruning the backup on the destination..."
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user