fix: report failed offsite backup pushes
This commit is contained in:
parent
c4b3d2132f
commit
73091460ae
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue