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.
This commit is contained in:
jared 2026-05-24 13:16:15 -04:00
parent 4ab40b9912
commit 309232cb26
1 changed files with 1 additions and 1 deletions

View File

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