Self-Hosting Healthchecks.io: Cron Job Monitoring
Healthchecks.io monitors your cron jobs and scheduled tasks. If a job doesn't check in on time, you get an alert.
The Problem
Cron jobs fail silently. Your nightly backup stopped running three weeks ago? You won't know until you need a restore.
How Healthchecks Works
It's a dead man's switch:
1. Create a check with an expected interval (e.g., every 24 hours)
2. Your cron job pings the check URL when it completes
3. If the ping doesn't arrive on time, you get an alert
Example
Backup cron job:
0 2 * * * /usr/local/bin/backup.sh && curl -m 10 https://hc.example.com/ping/uuid-here
If backup.sh fails, the curl never runs. Healthchecks notices the missing ping and alerts you.
Features
Checks
Alerting
Dashboard
Badges
Embed status badges in dashboards or documentation.
What to Monitor
Deployment
1. Deploy Healthchecks on TinyPod
2. Create checks for each cron job
3. Add ping URLs to your scripts
4. Configure notifications
Resources: 1 CPU, 512 MB RAM.
Best Practice
Ping on success AND failure:
curl -m 10 https://hc.example.com/ping/uuid/start
/usr/local/bin/backup.sh
curl -m 10 https://hc.example.com/ping/uuid/$?
This tracks execution time and failure status.