Blip
← All guides

Get a push notification when a cron job fails

A cron job that dies quietly can stay dead for weeks. One line after the job makes every failure a push you cannot miss.

1

Create a Cron channel in Blip

Install the Blip iOS app, tap + to create a channel named Cron, and copy its key (it starts with blip_live_). Export it on the server as BLIP_CRON_KEY.

2

Add one line after the job

The shell's || runs the curl only when the job exits non-zero. "priority": "high" makes the push time-sensitive, so a dead backup does not sit silently in a notification summary.

crontab
# crontab: run the job, blip only when it fails
0 3 * * * /home/you/backup.sh || curl -s -X POST https://blipnotify.com/api/v1/notify \
  -H "Authorization: Bearer $BLIP_CRON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Nightly backup failed","body":"backup.sh exited non-zero","priority":"high"}'
3

Test it by faking a failure

Swap the job for false once to force the failure path, and watch your phone.

terminal
false || curl -s -X POST https://blipnotify.com/api/v1/notify \
  -H "Authorization: Bearer $BLIP_CRON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"Nightly backup failed","body":"backup.sh exited non-zero","priority":"high"}'

201 { "ok": true, "delivered": 1, "devices": 1 } · pushed to your iPhone

Same trick in GitHub Actions

Scheduled workflows fail just as quietly. Add a step gated on if: failure() with your channel key in the repo's secrets.

.github/workflows/nightly.yml
steps:
  - name: Run nightly job
    run: ./scripts/nightly.sh

  - name: Blip on failure
    if: failure()
    run: |
      curl -s -X POST https://blipnotify.com/api/v1/notify \
        -H "Authorization: Bearer ${{ secrets.BLIP_CRON_KEY }}" \
        -H "Content-Type: application/json" \
        -d '{"title":"Nightly job failed","body":"${{ github.workflow }} on ${{ github.repository }}","priority":"high"}'

That's the whole setup.

Blip is free to try for 14 days, every feature included. After that it is $29.99/yr or $9/mo: see pricing.

Download on the App Store

More guides