restic: backup scripts should use absolute paths

main
Jef Roosens 2024-01-11 10:44:11 +01:00
parent a6e4beefb3
commit 1afca6be94
Signed by: Jef Roosens
GPG Key ID: 02D4C0997E74717B
3 changed files with 5 additions and 5 deletions

View File

@ -6,7 +6,7 @@ snapshot_dir="${data_dir}.snapshot"
# Read-only snapshot for atomic backup
btrfs subvolume snapshot -r "$data_dir" "$snapshot_dir" || exit $?
restic backup "$snapshot_dir"
/usr/local/bin/restic backup "$snapshot_dir"
# Always remove snapshot subvolume, even if restic fails
btrfs subvolume delete "$snapshot_dir"

View File

@ -53,4 +53,4 @@
name: 'Perform nightly backups'
minute: '0'
hour: '2'
job: 'bash /etc/backups/backup-all.sh'
job: '/usr/bin/bash /etc/backups/backup-all.sh'

View File

@ -9,9 +9,9 @@ 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"
/usr/bin/bash "$script"
done
# Prune older backups
restic forget --keep-last 7 && \
restic prune
/usr/local/bin/restic forget --keep-last 7 && \
/usr/local/bin/restic prune