Compare commits
No commits in common. "391ca1d275aac6a3d83fe8b3300124bfe635e9df" and "31309f2576a8ce9843e368b9d05818fc0c41d375" have entirely different histories.
391ca1d275
...
31309f2576
23
btrbk-cron
23
btrbk-cron
@ -24,7 +24,6 @@ fi
|
||||
HEALTHCHECK_URL=${HEALTHCHECK_URL:-http://127.0.0.1}
|
||||
HEALTHCHECK_ENABLE=${HEALTHCHECK_ENABLE:-false}
|
||||
FAIL_IF_TARGET_UNREACHABLE=${FAIL_IF_TARGET_UNREACHABLE:-true}
|
||||
IGNORE_TARGET_UNREACHABLE=${IGNORE_TARGET_UNREACHABLE:-false}
|
||||
CURLOPTS=(-fsS -m 10 --retry 5)
|
||||
|
||||
if [[ ! -d /run/btrbk ]] ; then
|
||||
@ -67,18 +66,16 @@ SSHUSER=$(echo "${SSHUSER}" | sed -r 's/.*ssh_user[\ \t]+//g')
|
||||
|
||||
SSH_OK=$(ssh -i "${IDENTITYFILE}" "${SSHUSER}@${HOST}" "which btrfs")
|
||||
|
||||
if [[ "${IGNORE_TARGET_UNREACHABLE}" = "false" ]] ; then
|
||||
if [[ "${SSH_OK}" = "" ]] ; then
|
||||
echo "Warning: exiting because of backup destination unreachable" | tee -a "${LOGFILE}"
|
||||
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
||||
curl "${CURLOPTS[@]}" --data-binary "@${LOGFILE}" "${HEALTHCHECK_URL}/log"
|
||||
fi
|
||||
rm -f -- "${LOGFILE}"
|
||||
if [[ "${FAIL_IF_TARGET_UNREACHABLE}" = "true" ]] ; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
if [[ "${SSH_OK}" = "" ]] ; then
|
||||
echo "Warning: exiting because of backup destination unreachable" | tee -a "${LOGFILE}"
|
||||
if [[ "${HEALTHCHECK_ENABLE}" = "true" ]] ; then
|
||||
curl "${CURLOPTS[@]}" --data-binary "@${LOGFILE}" "${HEALTHCHECK_URL}/log"
|
||||
fi
|
||||
rm -f -- "${LOGFILE}"
|
||||
if [[ "${FAIL_IF_TARGET_UNREACHABLE}" = "true" ]] ; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
HEALTHCHECK_ENABLE=true
|
||||
HEALTHCHECK_URL=https://my.selfhosted.healthcheck.com/ping/e48e4add-c17c-467c-9a91-7b245ad57fe8
|
||||
FAIL_IF_TARGET_UNREACHABLE=true
|
||||
IGNORE_TARGET_UNREACHABLE=false
|
||||
|
6
debian/changelog
vendored
6
debian/changelog
vendored
@ -1,9 +1,3 @@
|
||||
btrbk-cron (0.4.3) stable; urgency=medium
|
||||
|
||||
* added flag IGNORE_TARGET_UNREACHABLE
|
||||
|
||||
-- Paolo Asperti <paolo@asperti.com> Sat, 01 Feb 2025 14:06:08 +0100
|
||||
|
||||
btrbk-cron (0.4.2) stable; urgency=medium
|
||||
|
||||
* gather all logs
|
||||
|
Loading…
x
Reference in New Issue
Block a user