added kuma
This commit is contained in:
parent
876288be46
commit
1c3b8ca855
2 changed files with 28 additions and 4 deletions
30
backup.sh
30
backup.sh
|
@ -13,11 +13,21 @@ fi
|
||||||
running=$(pgrep -f "$BACKUP_CMD")
|
running=$(pgrep -f "$BACKUP_CMD")
|
||||||
if [[ $running ]]; then
|
if [[ $running ]]; then
|
||||||
echo "Backup alreadying running : $running. Exiting..."
|
echo "Backup alreadying running : $running. Exiting..."
|
||||||
curl https://hc-ping.com/$HEALTHCHECK_UUID/fail
|
if [[ $HEALTHCHECK_UUID != "" ]]; then
|
||||||
|
curl "https://hc-ping.com/$HEALTHCHECK_UUID/fail"
|
||||||
|
fi
|
||||||
|
if [[ $KUMA_ID != "" ]]; then
|
||||||
|
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=down&msg=Failed&ping="
|
||||||
|
fi
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo "Not currently running. Continuing..."
|
echo "Not currently running. Continuing..."
|
||||||
curl https://hc-ping.com/$HEALTHCHECK_UUID/start
|
if [[ $HEALTHCHECK_UUID != "" ]]; then
|
||||||
|
curl "https://hc-ping.com/$HEALTHCHECK_UUID/start"
|
||||||
|
fi
|
||||||
|
if [[ $KUMA_ID != "" ]]; then
|
||||||
|
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=up&msg=Running&ping="
|
||||||
|
fi
|
||||||
if [[ $PRE_RUN_SCRIPT ]]; then
|
if [[ $PRE_RUN_SCRIPT ]]; then
|
||||||
$dir/$PRE_RUN_SCRIPT
|
$dir/$PRE_RUN_SCRIPT
|
||||||
fi
|
fi
|
||||||
|
@ -26,7 +36,17 @@ if [[ $? == 0 ]]; then
|
||||||
if [[ $POST_RUN_SCRIPT ]]; then
|
if [[ $POST_RUN_SCRIPT ]]; then
|
||||||
$dir/$POST_RUN_SCRIPT
|
$dir/$POST_RUN_SCRIPT
|
||||||
fi
|
fi
|
||||||
curl https://hc-ping.com/$HEALTHCHECK_UUID
|
if [[ $HEALTHCHECK_UUID != "" ]]; then
|
||||||
else
|
curl "https://hc-ping.com/$HEALTHCHECK_UUID"
|
||||||
curl https://hc-ping.com/$HEALTHCHECK_UUID/fail
|
fi
|
||||||
|
if [[ $KUMA_ID != "" ]]; then
|
||||||
|
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=up&msg=Completed&ping="
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if [[ $HEALTHCHECK_UUID != "" ]]; then
|
||||||
|
curl "https://hc-ping.com/$HEALTHCHECK_UUID/fail"
|
||||||
|
fi
|
||||||
|
if [[ $KUMA_ID != "" ]]; then
|
||||||
|
curl "https://$KUMA_URL/api/push/$KUMA_ID?status=down&msg=Failed&ping="
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,6 +8,10 @@ BACKUP_PARAMS=""
|
||||||
BACKUP_EXCLUDE_FILE=""
|
BACKUP_EXCLUDE_FILE=""
|
||||||
# https://healthchecks.io uuid
|
# https://healthchecks.io uuid
|
||||||
HEALTHCHECK_UUID=""
|
HEALTHCHECK_UUID=""
|
||||||
|
# Uptime Kuma URL
|
||||||
|
KUMA_URL=""
|
||||||
|
# Uptime Kuma Push ID
|
||||||
|
KUMA_ID=""
|
||||||
# name of a script to run before (ideally in the "pre/" dir)
|
# name of a script to run before (ideally in the "pre/" dir)
|
||||||
PRE_RUN_SCRIPT=""
|
PRE_RUN_SCRIPT=""
|
||||||
# name of a script to run after (ideally in the "post/" dir)
|
# name of a script to run after (ideally in the "post/" dir)
|
||||||
|
|
Loading…
Reference in a new issue