Getting alerted when a scheduled job stops running
Use a heartbeat to know when a backup, import or other automatic task didn't run.
Some things run automatically behind the scenes: a nightly backup, an import, a weekly report. When one quietly stops, nobody notices until it matters. A heartbeat fixes that. Your job tells OffAlerts “I ran” each time it finishes, and we alert you when that message stops arriving on time.
Use it for backups, scheduled imports, report emails, or anything that runs on a timer (developers often call these “cron jobs”).
The last step needs a small change to the job itself. If someone else looks after your server or automation, send them this article.
Set it up
- Open Heartbeats and create one (or go to app.offalerts.com/heartbeat-create).
- Name it after the job, such as “Nightly database backup”.
- Say how often the job runs, for example every 1 day.
- Set a grace period: how late the job may be before we alert. Give slow jobs room.
- Pick a notification channel and save.
- Copy the heartbeat’s web address (its URL).
Make your job check in
The job needs to open the heartbeat’s address when it finishes. In a no-code tool such as Zapier or Make, add a final “HTTP request” or “webhook” step pointing at the address.
On a server, add one line at the end of the job. With cron it looks like this:
0 3 * * * /home/me/backup.sh && curl -fsS "YOUR_HEARTBEAT_URL" > /dev/null
The && matters: the address is only opened if the backup succeeded.
What happens next
Each time the job checks in, the timer resets. If no check-in arrives within the expected time plus the grace period, the heartbeat is marked down and you’re alerted. When the job checks in again, you’re told it recovered.
It alerts, but the job ran
- The job runs less often than the schedule you entered. Lengthen it or add grace.
- The check-in is being blocked on its way out of your server. Run the
curlline by hand on that machine to see. - The job ran but exited with an error before reaching the last line.
Still stuck?
Email [email protected] with the heartbeat’s name and when the job last ran. We can look at what happened on our side.