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