Fix healthcheck caching volume

This commit is contained in:
Andras Schmelczer 2025-08-09 22:58:53 +01:00
parent 8261031e11
commit dd8a61792f
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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