Get an alert when a cron job doesn’t run.
Cron starts jobs on time, but it never tells you when one doesn’t start or fails. Add one line to the crontab, and Runbell alerts you when a run is late, missing or failed.
Up
sync-orders
- Schedule
*/10 * * * *every 10 minutes- Grace period
- 5 minutes
- Alerts
- Telegram or Slack
What goes wrong without anyone noticing
- The cron daemon isn’t running
- After an upgrade or a reboot, cron doesn’t start, and none of the jobs run.
- Someone edits the crontab
- A typo or a deleted line, and a job disappears without a word.
- The job errors out
- Cron mails the output to a mailbox nobody reads, if mail is set up at all.
Set it up
-
Create a check
Use the schedule
*/10 * * * *and a grace period of 5 minutes, in the time zone the job runs in. -
Add the ping
Put the ping after the job on the same crontab line, with the job’s exit code at the end.
-
Choose who hears about it
Connect email, Slack, Telegram, SMS or any of the other channels to the project.
crontab -e
*/10 * * * * /usr/local/bin/sync-orders.sh; curl -fsS -m 10 --retry 5 -o /dev/null https://runbell.app/ping/your-check-id/$?
Tips
- Use the same cron expression in Runbell as in the crontab, and the server’s time zone.
- Join the commands with
;and send/$?, not&&: then failed runs are reported too, not only good ones. - Not sure what an expression means? Paste it into the free cron tool first.
Questions
Do I need to install an agent?
No. curl or wget is enough, and one of them is on almost every Linux server.
Does it work with systemd timers?
Yes. Add the curl call to the service’s ExecStartPost=, or at the end of the script it runs.
Other jobs to watch
- pg_dump, mysqldump Database backups Know the night a backup fails, not the day you need it.
- PowerShell Windows Task Scheduler Know when a scheduled task didn’t run or failed.
- batch/v1 Kubernetes CronJobs Catch the CronJob that never started a pod.
- ETL, Airflow, reports ETL and reports Hear about the pipeline that didn’t finish before the morning meeting.
- certbot, ACME Certificate renewal Find out before an expired certificate does.