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
This commit is contained in:
uprightbass360
2025-11-17 02:38:59 -05:00
parent 5606cdeed0
commit 9deff01441

View File

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