Last active
February 25, 2023 14:21
-
-
Save Mic92/a8d202598d222bbc5542b5a95faa859f to your computer and use it in GitHub Desktop.
Sent pushover warnings when a systemd service failed (useful for backups and systemd timers)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=pushover warning | |
[Service] | |
Type=oneshot | |
ExecStart=/usr/bin/curl -s \ | |
--form-string "token=<PUSHOVER_APPLICATION_TOKEN>" \ | |
--form-string "user=<PUSHOVER_USER_TOKEN>" \ | |
--form-string "message=service %I at %H failed" \ | |
https://api.pushover.net/1/messages.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=rsnapshot (%I) backup | |
# if the task fails pushover-warning will be triggered. | |
OnFailure=pushover-warning@%n.service | |
[Service] | |
Type=oneshot | |
Nice=19 | |
IOSchedulingClass=3 | |
ExecStart=/usr/bin/rsnapshot %I |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment