Send iPhone and Android alerts when cron jobs fail,
Cron jobs usually fail in the most annoying way possible: quietly. A backup stops running, a sync job exits with an error, or a script never starts again after a deployment, and nobody notices until something else breaks.
Signalgrid gives you a simple way to send push alerts from cron-driven jobs so you know when a task fails, when it succeeds, and when a job has gone missing entirely.
What you need
- A Signalgrid account
- Your client key
- A channel token
- A cron job or shell script you want to monitor
Wrap the job and alert on success or failure
The easiest pattern is to wrap the real command, capture its exit code, and send either a success or critical push notification.
Run the wrapper from cron
Put the wrapper somewhere stable and let cron run that file instead of calling the job directly.
Detect missing cron jobs with a heartbeat file
Success and failure alerts are useful, but they do not catch the case where a cron job simply stops running. A basic heartbeat file closes that gap.
At the end of your job, write the current timestamp into a file such as /var/tmp/nightly-backup.heartbeat. Then let a second watchdog script alert you if the file gets too old.
Run the watchdog from cron too
When to use critical notifications
- Use
critical=truefor jobs that can cause downtime, data loss, or production incidents when they stop running. - Use normal notifications for low-risk success events so your phone does not become background noise.
- Split success, warning, and failure events by
typeto keep the notification stream readable.