I Built a Cron Job Monitoring API in a Weekend
Source: Dev.to
Problem
Every developer has at least one cron job running somewhere—backups, data processing, sending reports.
When a cron job stops running, the failure often goes unnoticed for days or weeks because cron does not notify you about failures by default.
Solution: CronPing
CronPing is a lightweight API for monitoring cron jobs. It lets you:
- Register a monitor with an expected interval
- Ping the service from your cron job
- Receive alerts (e.g., via webhook) when a job misses its schedule
Before (silent failure)
0 2 * * * /opt/backup.sh
After (monitored)
0 2 * * * /opt/backup.sh && curl -s https://cronping.anethoth.com/ping/abc123
Usage
Sign up
curl -X POST https://cronping.anethoth.com/api/v1/signup \
-H "Content-Type: application/json" \
-d '{ "email": "you@example.com" }'
Create a monitor
curl -X POST https://cronping.anethoth.com/api/v1/monitors \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "nightly-backup",
"interval_seconds": 86400,
"grace_seconds": 300
}'
Add the ping to your cron job
... && curl -s https://cronping.anethoth.com/ping/YOUR_TOKEN
Implementation Details
- Framework: FastAPI for the API layer
- Storage: SQLite for persisting monitor data
- Background processing: Periodic task checks for overdue monitors
- Deployment: Docker container for easy rollout
Pricing
- Free tier: 3 monitors with a 7‑day history
- More monitors and longer retention are available on paid plans.
Check it out at https://cronping.anethoth.com.