fix(Mastercontainer): exit daily-backup.sh early if restore is running

If the backup container is currently running in restore mode, the daily
backup script now exits immediately instead of waiting indefinitely for
the container to stop. This prevents the daily backup cron from
interrupting long-running restores.

Fixes: #8414

Assisted-by: GitHub Copilot:claude-sonnet-4
This commit is contained in:
copilot-swe-agent[bot]
2026-07-31 09:37:54 +00:00
committed by GitHub
parent 5b94a3a27a
commit b03f28cb8e
@@ -13,6 +13,15 @@ if ! [ -f "$CONFIG_FILE" ] || (! grep -q "wasStartButtonClicked.*1" "$CONFIG_FIL
exit 0
fi
# Exit early if the backup container is currently running a restore
if docker ps --format "{{.Names}}" | grep -q "^nextcloud-aio-borgbackup$"; then
if grep -q '"backup-mode".*"restore"' "$CONFIG_FILE"; then
echo "Backup container is running in restore mode. Exiting to not interrupt the restore..."
rm -f "/mnt/docker-aio-config/data/daily_backup_running"
exit 0
fi
fi
# Daily backup and backup check cannot be run at the same time
if [ "$DAILY_BACKUP" = 1 ] && [ "$CHECK_BACKUP" = 1 ]; then
echo "Daily backup and backup check cannot be run at the same time. Exiting..."