From 309232cb26b26e546bc325c1624ed40173b3b86d Mon Sep 17 00:00:00 2001 From: jared Date: Sun, 24 May 2026 13:16:15 -0400 Subject: [PATCH] fix(backup): validate Synology backup path is accessible Check that /volume1/backup is actually reachable and readable, rather than just testing SSH connectivity. This prevents false positives where SSH works but the backup destination is offline or unmounted. --- scripts/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index a7de7ab..1d91bd9 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -61,7 +61,7 @@ run_and_notify() { echo "=== Backup started $(date) ===" | tee -a "$LOG" # Synology: attempt only if reachable (SSH key auth, 30s timeout for HDD spin-up) -if ssh -o ConnectTimeout=30 -o BatchMode=yes synology true 2>/dev/null; then +if ssh -o ConnectTimeout=30 -o BatchMode=yes synology 'ls /volume1/backup > /dev/null 2>&1' 2>/dev/null; then run_and_notify "sftp:${SYNOLOGY_HOST}:${SYNOLOGY_PATH}" "Synology" "desktop" "synology" else echo "Synology unreachable — skipping SFTP backup" | tee -a "$LOG"