Cron Job Monitoring: The Complete Guide
Cron jobs are the backbone of server-side automation — but they fail silently. This guide covers everything you need to know about monitoring scheduled tasks, detecting failures before they cause damage, and implementing the Dead Man's Switch pattern.
Why cron job monitoring matters
Cron jobs run in the background, without a user watching. When they fail, they fail silently. The cron daemon doesn't send you an alert. Your server doesn't call your phone. And unless you're actively looking at log files, you might not find out for days.
The consequences can be severe:
- Database backups that haven't run in a week
- Invoice generation that stopped three billing cycles ago
- Email reports that are quietly failing to send
- Data sync jobs that left your systems out of sync
- SSL renewal scripts that haven't run — until your cert expires
Cron job monitoring closes this gap. Instead of hoping your jobs run, you get proof that they ran — and an alert if they didn't.
The two approaches to cron job monitoring
1. Log-based monitoring
Some teams monitor cron jobs by watching log files or aggregating logs into a tool like Datadog or Papertrail. This works for catching errors within a running job. But it fails if the job never runs at all — because a job that doesn't execute produces no logs.
2. Dead Man's Switch monitoring
A Dead Man's Switch (DMS) turns the monitoring model around. Instead of watching for errors, you require your cron job to actively prove it ran. At the end of every successful execution, your job sends a small "I'm alive" ping to a monitoring service. If the ping is missed, the service alerts you.
This approach catches everything: jobs that fail with an error, jobs that time out, jobs that are silently skipped, and jobs that are accidentally disabled. If the ping doesn't arrive, you get an alert — no matter what the cause.
How to implement Dead Man's Switch monitoring
The implementation is simple. At the end of your cron job script, add a single HTTP request to TaskPulse. Here's how to do it in the most common environments:
Setup: Create a Heartbeat monitor
First, create a free TaskPulse account and create a Heartbeat monitor. Set the expected interval to match your cron schedule (e.g., 24h for a daily job) and set a tolerance window (e.g., 30 minutes). Copy the monitor UUID.
Bash / Shell scripts
#!/bin/bash
#!/bin/bash
# Your cron job logic here
/usr/local/bin/my-backup-script.sh
# Heartbeat ping at the end (only runs if script succeeded)
curl -s -X POST https://api.taskpulse.co/ping/YOUR-MONITOR-UUID
# Smart Heartbeat with metadata (always free)
curl -s -X POST https://api.taskpulse.co/ping/YOUR-MONITOR-UUID \
-H "Content-Type: application/json" \
-d '{"host": "'"$(hostname)"'", "job": "backup"}'In your crontab, add the job as usual. The ping at the end will only run if the preceding commands succeed (unless you use || true to force it):
# crontab entry — runs at 2am daily 0 2 * * * /usr/local/bin/run-backup.sh
Python
import requests
def main():
# Your job logic here
process_records()
# Heartbeat ping
requests.post(
"https://api.taskpulse.co/ping/YOUR-MONITOR-UUID",
json={"records_processed": record_count, "host": socket.gethostname()},
timeout=10
)
if __name__ == "__main__":
main()Node.js
import fetch from 'node-fetch';
async function main() {
// Your job logic here
const count = await processRecords();
// Heartbeat ping
await fetch('https://api.taskpulse.co/ping/YOUR-MONITOR-UUID', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ records_processed: count }),
});
}
main().catch(console.error);Understanding monitor statuses
TaskPulse uses the following status states for Heartbeat monitors:
pending— Monitor created, waiting for first pinghealthy— Last ping received within the expected windowfailed— Ping missed beyond the tolerance window — alert sentpaused— Monitor manually paused (e.g., during maintenance)frozen— Monitor not yet resolved after extended failure
Tracking throughput with Signal monitors
In addition to heartbeat monitoring, TaskPulse supports Signal monitors for tracking business metrics. For a cron job that processes records, you can send a Signal event for each batch processed:
curl -s -X POST https://api.taskpulse.co/signal/YOUR-SIGNAL-UUID \
-H "Content-Type: application/json" \
-d '{"status": "success", "records": 245, "job": "invoice-gen"}'Signal events count against your monthly quota (100/mo on Free, 50k/mo on Pro). See the integration guide for the full API reference.
Rate limits and payload limits
/pingendpoint: 120 requests/minute/signalendpoint: 60 requests/minute- Maximum payload size: 4KB
- Minimum check interval: 5 min (Free) | 1 min (Pro) | 10 sec (Business)
Pricing
- Free: 5 Heartbeat + 5 Signal monitors, 100 events/mo, email alerts
- Pro ($9/mo): 50 monitors, 50k events, Slack + Discord, 1-min intervals
- Business ($29/mo): 200 monitors, 1M events, Custom Webhooks, 10-sec intervals
See the full pricing page.
Frequently asked questions
What is cron job monitoring?
Cron job monitoring is the practice of verifying that scheduled tasks (cron jobs) run successfully on their expected schedule. A monitoring tool tracks each execution and alerts you if a job fails, runs too long, or stops running entirely.
What is a Dead Man's Switch in cron job monitoring?
A Dead Man's Switch (DMS) is a monitoring pattern where your cron job actively "checks in" with a monitoring service at the end of every successful run. If the check-in is missed, the monitoring service assumes something went wrong and sends an alert. This is more reliable than log-based monitoring because it catches complete job disappearances, not just errors.
How do I monitor a cron job on a Linux server?
Add a curl command at the end of your cron job script: `curl -s -X POST https://api.taskpulse.co/ping/YOUR-UUID`. This sends a heartbeat ping to TaskPulse after each successful run. Configure the expected interval and tolerance in the TaskPulse dashboard, then set up email or Telegram alerts.
Is there a free cron job monitoring tool?
Yes. TaskPulse offers a free plan with 5 Heartbeat monitors, 5 Signal monitors, and 100 signal events per month — no credit card required. The free plan is sufficient for most small projects and individual developers.
Can I monitor cron jobs across multiple servers?
Yes. Each TaskPulse monitor has a unique UUID endpoint. You can create separate monitors for cron jobs on different servers and monitor them all from a single dashboard. There's no agent or server-side software to install.