From 73091460aefd85f2e43b785685a963993bd0db3b Mon Sep 17 00:00:00 2001 From: "juvenal.diaz" Date: Wed, 28 Oct 2026 09:16:33 -0600 Subject: [PATCH] fix: report failed offsite backup pushes --- scripts/homelab-backup | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/homelab-backup b/scripts/homelab-backup index ccbbba9..e3b0e6c 100755 --- a/scripts/homelab-backup +++ b/scripts/homelab-backup @@ -245,8 +245,14 @@ push_offsite() { target="${uri#ssh://}" host="${target%%/*}" path="/${target#*/}" - ssh -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "${host}" "mkdir -p '${path}'" - scp -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "${archive}" "${host}:${path}/" + if ! ssh -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "${host}" "mkdir -p '${path}'"; then + echo "Offsite SSH target is unreachable: ${host}" >&2 + return 1 + fi + if ! scp -o BatchMode=yes -o ConnectTimeout=10 -o StrictHostKeyChecking=accept-new "${archive}" "${host}:${path}/"; then + echo "Offsite SSH upload failed: ${host}:${path}" >&2 + return 1 + fi ;; *) echo "Unsupported HOMELAB_BACKUP_OFFSITE_URI: ${uri}" >&2