2024-01-10 13:51:51 +01:00
|
|
|
#!/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
|
2024-01-11 10:44:11 +01:00
|
|
|
/usr/bin/bash "$script"
|
2024-01-10 13:51:51 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
# Prune older backups
|
2024-01-11 10:44:11 +01:00
|
|
|
/usr/local/bin/restic forget --keep-last 7 && \
|
|
|
|
/usr/local/bin/restic prune
|