How to Monitor Cron Jobs in Production (5-Minute Setup)
title: "How to Monitor Cron Jobs in Production (5-Minute Setup)" description: "A practical guide to monitoring cron jobs in production. Learn how to set up dead man's switch monitoring with one curl command and never miss a silent failure again." publishedAt: "2026-03-10" author: "SwiftLabs Team"
How to Monitor Cron Jobs in Production (5-Minute Setup)
Cron jobs fail silently. A database backup that hasn't run in three weeks. A data sync that stopped working after a deployment. An invoice generator that quietly broke during a dependency update.
You only find out when it's too late.
This guide shows you how to set up production-grade cron job monitoring in 5 minutes using a dead man's switch pattern.
The Problem with Cron Jobs
Traditional monitoring tells you when things crash. Cron job monitoring needs to tell you when things don't happen.
Your cron job doesn't log errors when:
- The cron daemon stops
- Your server runs out of disk space and cron can't write logs
- A silent exception gets swallowed
- A dependency changes and your script exits early
- The entire server goes down
Exit codes won't save you. Log files won't save you. You need a dead man's switch.
What Is a Dead Man's Switch?
A dead man's switch expects regular check-ins. If a check-in doesn't arrive on schedule, it alerts you.
Instead of asking "did this fail?", it asks "did this succeed?". Absence of success = failure.
For cron jobs, this means:
- Your cron job pings a monitoring endpoint on success
- The monitor expects a ping within a specific time window
- If no ping arrives, you get alerted
5-Minute Setup with CronMonitor
Step 1: Create a Monitor (30 seconds)
Sign up at CronMonitor and create a new monitor:
- Name: Daily database backup
- Expected interval: 24 hours
- Grace period: 2 hours
You'll get a unique ping URL:
https://cronmonitor.swiftlabs.dev/api/ping/a3f8c9d2-7e4b-4a1c-9f3e-8d2c7b4a1e6f
Step 2: Add One Line to Your Cron Job (1 minute)
Update your crontab to ping the URL after success:
0 2 * * * /scripts/backup-database.sh && curl -fsS https://cronmonitor.swiftlabs.dev/api/ping/a3f8c9d2-7e4b-4a1c-9f3e-8d2c7b4a1e6f
The && ensures the ping only happens if the script succeeds.
Step 3: Configure Alerts (1 minute)
Set up your notification preferences:
- Email alerts - Get an email when a ping is missed
- Webhook alerts - Send to Slack, Discord, PagerDuty, or any webhook endpoint
Step 4: Test It (2 minutes)
Run your cron job manually:
/scripts/backup-database.sh && curl -fsS https://cronmonitor.swiftlabs.dev/api/ping/a3f8c9d2-7e4b-4a1c-9f3e-8d2c7b4a1e6f
Check the CronMonitor dashboard. You should see the ping logged with a timestamp.
To test the alert:
- Don't ping for longer than your expected interval + grace period
- Wait for the alert (CronMonitor checks every minute)
- Verify you receive the email or webhook
Done. Your cron job is monitored.
Advanced Patterns
Multiple Cron Jobs
Monitor different jobs with different intervals:
# Daily backup (24h interval)
0 2 * * * /scripts/backup.sh && curl -fsS https://cronmonitor.swiftlabs.dev/api/ping/backup-token
# Hourly sync (1h interval)
0 * * * * /scripts/sync.sh && curl -fsS https://cronmonitor.swiftlabs.dev/api/ping/sync-token
# Weekly report (7d interval)
0 9 * * 1 /scripts/report.sh && curl -fsS https://cronmonitor.swiftlabs.dev/api/ping/report-token
Webhook Integration
Send alerts to Slack:
- Create a Slack webhook:
https://hooks.slack.com/services/T00/B00/XXX - Add it to your CronMonitor settings
- When a ping is missed, you'll get a Slack notification
Retry Logic
Add retries for network issues:
0 2 * * * /scripts/backup.sh && curl -fsS --retry 3 --retry-delay 5 https://cronmonitor.swiftlabs.dev/api/ping/token
Logging the Ping
Capture the ping response for debugging:
0 2 * * * /scripts/backup.sh && curl -fsS https://cronmonitor.swiftlabs.dev/api/ping/token > /tmp/ping.log 2>&1
What to Monitor
Not every cron job needs monitoring. Focus on:
- Data integrity jobs - Database backups, ETL pipelines, data validation
- Business-critical jobs - Invoice generation, payment processing, order fulfillment
- Security jobs - Certificate renewal, log rotation, access audits
- Health checks - Service uptime checks, disk space monitoring, dependency validation
Skip monitoring for:
- Truly optional jobs where failure doesn't matter
- Jobs that run so frequently (every minute) that transient failures are acceptable
- Development or staging environments (unless you're testing the monitoring itself)
Troubleshooting
Ping Not Showing Up
Check:
- The curl command succeeds (run it manually)
- The token is correct (copy from dashboard)
- Network connectivity from your server
- Firewall rules allow outbound HTTPS
False Positives
If you're getting alerts but the job is running:
- Check the grace period - might be too short
- Verify the expected interval matches your cron schedule
- Look for script failures that happen before the ping
Late Pings
If pings arrive late:
- Check server time (use
dateand compare to UTC) - Look for long-running tasks before the ping
- Increase the grace period to account for normal variance
Free Tier
CronMonitor's free tier includes:
- 3 monitors
- Email alerts
- Webhook alerts
- Ping history
- Unlimited pings
Perfect for side projects and small deployments.
Conclusion
Monitoring cron jobs is simple:
- Add a ping URL to your crontab
- Set an expected interval
- Get alerted when pings stop
Five minutes now saves hours of debugging later.
Try CronMonitor — no credit card required.