How to Monitor Cron Jobs with a Simple HTTP Health Check
Cron jobs are great for automating repetitive tasks, but there is one problem:
What happens when the job stops running?
A cron entry can exist for months without anyone noticing that the script has started failing.
For example, you might have a backup job running every night:
0 2 * * * /path/to/backup.sh
`
Everything looks fine until the backup silently fails.
One simple way to solve this is to make the job send an HTTP request whenever it completes successfully.
## The basic idea
Instead of only running the job, make it report that it is alive:
0 2 * * * /path/to/backup.sh && curl https://ping.doyouok.com/ping/YOUR-API-KEY
plaintext
The monitoring service records the check-in.
If the expected check-in doesn't arrive within the configured interval, you receive an alert.
This creates a simple "dead man's switch" for your scheduled jobs.
## Why HTTP check-ins work well
There is no agent to install and no special monitoring software required on the server.
Your existing script simply makes an HTTP request after a successful run.
This approach can work for:
- Linux cron jobs
- Windows scheduled tasks
- Database backups
- Import/export jobs
- Background scripts
- Data processing jobs
- n8n workflows
- Make scenarios
- Zapier automations
The important part is that the process reports success.
## Example with a shell script
You can also keep the monitoring logic inside your script:
`
!/bin/bash
/path/to/backup.sh
if [ $? -eq 0 ]; then
curl -fsS https://ping.doyouok.com/ping/YOUR-API-KEY
fi
`
Now the monitoring request is only sent when the backup succeeds.
If the script fails, there is no check-in.
If there is no check-in within the expected time, the monitor can alert you.
## Monitoring more than cron
The same pattern is useful for other automated processes.
For example, a scheduled database export might finish successfully every six hours. Instead of trying to inspect the server manually, the export process can simply check in when it completes.
The same idea can also be used with automation platforms such as n8n, Make, and Zapier.
You don't necessarily need a complicated monitoring stack for a simple question:
"Did this process run successfully?"
## I built Doyouok for this
I've been working on Doyouok to provide simple monitoring for processes that should keep running.
It uses HTTP check-ins and alerts when an expected check-in is missed.
There is nothing to install on the machine running the job.
You can start with the free plan and create checks for your own cron jobs, scheduled tasks, scripts, backups, and automation workflows.
Doyouok: https://doyouok.com/
## Final thought
For many scheduled jobs, monitoring doesn't need to be complicated.
A simple successful HTTP check-in can answer an important question:
"Is this job still running?"
If the answer suddenly becomes "no", that's when you want to know about it — not several days later when you discover that your backups or automation have stopped.
Top comments (0)