From 9deff014417c9e5b2b70280406f45722e73973b4 Mon Sep 17 00:00:00 2001 From: uprightbass360 Date: Mon, 17 Nov 2025 02:38:59 -0500 Subject: [PATCH] fix: prevent backup from running immediately on container startup - Initialize last_backup to current time instead of 0 - Prevents capturing fresh/incomplete database state - First backup now runs after configured interval (default 5 minutes) - Adds helpful log message showing when first backup will run --- scripts/bash/backup-scheduler.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/bash/backup-scheduler.sh b/scripts/bash/backup-scheduler.sh index 52204a4..fd987da 100755 --- a/scripts/bash/backup-scheduler.sh +++ b/scripts/bash/backup-scheduler.sh @@ -208,8 +208,9 @@ cleanup_old() { log "Backup scheduler starting: interval(${BACKUP_INTERVAL_MINUTES}m), daily($RETENTION_DAYS d at ${DAILY_TIME}:00)" -# Initialize last backup time -last_backup=0 +# Initialize last backup time to current time to prevent immediate backup on startup +last_backup=$(date +%s) +log "ℹ️ First backup will run in ${BACKUP_INTERVAL_MINUTES} minutes" while true; do current_time=$(date +%s)