added gotify mess on error
This commit is contained in:
parent
35724b700d
commit
20864164be
@ -6,6 +6,11 @@ export RESTIC_REPOSITORY="stfp:{{ pillar.restic.user }}@{{ pillar.restic.host }}
|
||||
{%- endif %}
|
||||
export RESTIC_PASSWORD={{ pillar.restic.password }}
|
||||
|
||||
GOTIFY_URL="{{ pillar.restic.gotify.url }}"
|
||||
GOTIFY_TOKEN="{{ pillar.restic.gotify.token }}"
|
||||
GOTIFY_PRIO="5"
|
||||
GOTIFY_TITLE="backup on $HOSTNAME"
|
||||
|
||||
restic backup \
|
||||
--exclude="*.tmp" \
|
||||
--exclude="lost+found" \
|
||||
@ -49,3 +54,10 @@ restic backup \
|
||||
/etc \
|
||||
/root \
|
||||
/home
|
||||
|
||||
return_code="$?"
|
||||
if [[ "$return_code" == "0" ]]; then
|
||||
exit 0
|
||||
fi
|
||||
MESSAGE="$(journalctl -u restic-backup.service -p 5 --since today)"
|
||||
curl "$GOTIFY_URL/message?token=$GOTIFY_TOKEN" -F "title=$GOTIFY_TITLE" -F "priority=$GOTIFY_PRIO" -F "message=$MESSAGE"
|
||||
|
Reference in New Issue
Block a user