From b03f28cb8eca707c417f0ca9c337055a9e17a51e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Jul 2026 09:37:54 +0000 Subject: [PATCH] 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 --- Containers/mastercontainer/daily-backup.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Containers/mastercontainer/daily-backup.sh b/Containers/mastercontainer/daily-backup.sh index 99293b60..737a38c6 100644 --- a/Containers/mastercontainer/daily-backup.sh +++ b/Containers/mastercontainer/daily-backup.sh @@ -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..."