Fix healthcheck caching volume
This commit is contained in:
parent
8261031e11
commit
dd8a61792f
3 changed files with 4 additions and 4 deletions
|
|
@ -31,7 +31,7 @@ services:
|
|||
- /volumes/backup/logs:/backup-logs # we will store the output of the backup commands in this folder
|
||||
- borg-cache:/root/.cache/borg # speed up subsequent backups
|
||||
|
||||
- health-flag:/backup_completion_time.log # this is used to determine if the backup was successful and when it was last run
|
||||
- health-flag:/health/backup_completion_time.log # this is used to determine if the backup was successful and when it was last run
|
||||
|
||||
- /bulk/backup:/local-backup # this is an example target backup path for BORG_REPO_1 from above
|
||||
- /volumes/backup/config/id_rsa:/root/.ssh/id_rsa # this is an example for mounting an ssh key for a remote repo (BORG_REPO_0 above)
|
||||
|
|
|
|||
|
|
@ -49,4 +49,4 @@ borg compact --threshold=5 --cleanup-commits --verbose --progress
|
|||
btrfs subvolume delete /snapshot/source
|
||||
|
||||
echo "Finished backup script at `date`"
|
||||
date > /backup_completion_time.log # this used by the healtcheck
|
||||
date > /health/backup_completion_time.log # this used by the healtcheck
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
set -e
|
||||
|
||||
if [ -f /backup_completion_time.log ]; then
|
||||
if [ -f /health/backup_completion_time.log ]; then
|
||||
current_time=$(date +%s)
|
||||
backup_time=$(date --file /backup_completion_time.log +%s)
|
||||
backup_time=$(date --file /health/backup_completion_time.log +%s)
|
||||
age_in_seconds=$((current_time - backup_time))
|
||||
|
||||
if [ ${age_in_seconds} -lt ${MAX_BACKUP_AGE_SECONDS} ]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue