Integrate restic backup system
This commit is contained in:
parent
c38bda8dfd
commit
a6e4beefb3
6 changed files with 84 additions and 2 deletions
17
roles/restic/templates/backup-all.sh.j2
Normal file
17
roles/restic/templates/backup-all.sh.j2
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script sequentially executes all shell scripts matching
|
||||
# /etc/backups/*.backup.sh, with environment variables configured to publish
|
||||
# backups to the local Restic REST server.
|
||||
|
||||
# Get passed along to subcalls to bash
|
||||
export RESTIC_REPOSITORY='rest:http://{{ groups['nas'][0] }}:8000/backups'
|
||||
export RESTIC_PASSWORD_FILE='/etc/backups/restic_backups_passwd'
|
||||
|
||||
for script in $(find /etc/backups -name '*.backup.sh'); do
|
||||
bash "$script"
|
||||
done
|
||||
|
||||
# Prune older backups
|
||||
restic forget --keep-last 7 && \
|
||||
restic prune
|
||||
Loading…
Add table
Add a link
Reference in a new issue