How to Monitor Cron Jobs with Push Alerts

Updated on October 28, 2026

Send iPhone and Android alerts when cron jobs fail,
stop running, or finish successfully.

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.

Bash
#!/bin/sh /usr/local/bin/nightly-backup.sh STATUS=$? if [ "$STATUS" -eq 0 ]; then curl -s -X POST https://api.signalgrid.co/v1/push \ -d "client_key=YOUR_CLIENT_KEY" \ -d "channel=YOUR_CHANNEL_TOKEN" \ -d "title=Nightly backup finished" \ -d "body=The backup job completed successfully." \ -d "type=SUCCESS"; else curl -s -X POST https://api.signalgrid.co/v1/push \ -d "client_key=YOUR_CLIENT_KEY" \ -d "channel=YOUR_CHANNEL_TOKEN" \ -d "title=Nightly backup failed" \ -d "body=The backup job exited with status $STATUS." \ -d "type=CRIT" \ -d "critical=true"; fi exit "$STATUS"

Run the wrapper from cron

Put the wrapper somewhere stable and let cron run that file instead of calling the job directly.

Cron
0 2 * * * /usr/local/bin/nightly-backup-wrapper.sh

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.

Bash
#!/bin/sh HEARTBEAT_FILE="/var/tmp/nightly-backup.heartbeat" MAX_AGE=7200 NOW=$(date +%s) LAST_RUN=$(cat "$HEARTBEAT_FILE") AGE=$((NOW - LAST_RUN)) if [ "$AGE" -gt "$MAX_AGE" ]; then curl -s -X POST https://api.signalgrid.co/v1/push \ -d "client_key=YOUR_CLIENT_KEY" \ -d "channel=YOUR_CHANNEL_TOKEN" \ -d "title=Cron heartbeat missing" \ -d "body=The nightly backup job has not checked in within the expected time window." \ -d "type=CRIT" \ -d "critical=true"; fi

Run the watchdog from cron too

Cron
15 * * * * /usr/local/bin/check-nightly-backup-heartbeat.sh

When to use critical notifications

  • Use critical=true for 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 type to keep the notification stream readable.