Monitor Cron Jobs Without Changing Your Setup
Keep your cron. Keep your scripts. Add one curl line. Get instant alerts when jobs fail or return wrong results.
The Problem: Silent Cron Job Failures
Cron jobs fail silently. If your backup script crashes, your database sync stops, or your cleanup job never runs, you won't know until it's too late. Common failure scenarios:
- Script crashes due to unhandled exceptions
- Disk space runs out, causing writes to fail
- Network timeouts when connecting to external services
- Permission errors after system updates
- Cron daemon stops or gets disabled
Traditional monitoring tools (Nagios, Zabbix) require complex setup and don't understand cron semantics. You need a dead man switch: if your job doesn't ping within the expected interval, you get an alert.
Solution: Dead Man Switch Monitoring
DeadManPing doesn't run your jobs. Your cron does. DeadManPing only observes.
A dead man switch works like this: your cron job pings a monitoring service after each successful run. If the ping doesn't arrive within the expected time window, you get an alert. It's simple, reliable, and works with any language or environment.
Add One Line to Your Existing Script
Important: The curl command must be inside your script, not in the cron line, because only in the script do you have access to variables from execution results.
#!/bin/bash# Your existing backup script here./backup.sh# Add this one line at the endcurl -X POST "https://deadmanping.com/ping/backup-daily" \ -H "Content-Type: application/json" \ -d '{`"success": true}'In crontab: 0 3 * * * /path/to/backup.sh
Your cron runs your script. Your script executes logic. At the end of your script — one curl line with data from execution.
Reporting Failures with Data from Execution
You can report failures explicitly and include data from execution:
#!/bin/bashif ./backup.sh; then BACKUP_SIZE=$(du -sh /backups/latest | cut -f1) curl -X POST "https://deadmanping.com/ping/backup-daily" \ -H "Content-Type: application/json" \ -d "{\"success\": true, \"backup_size\": \"$BACKUP_SIZE\"}"else ERROR_MSG=$(./backup.sh 2>&1 | tail -1) curl -X POST "https://deadmanping.com/ping/backup-daily" \ -H "Content-Type: application/json" \ -d "{\"success\": false, \"error\": \"$ERROR_MSG\"}"fiLanguage-Specific Examples
Python
import requestsimport systry: # Your backup logic here run_backup() requests.post("https://deadmanping.com/api/ping/backup-daily?s=ok")except Exception as e: requests.post(f"https://deadmanping.com/api/ping/backup-daily?s=fail&m={str(e)}") sys.exit(1)Node.js
const https = require('https');async function runBackup() { try { await performBackup(); https.request('https://deadmanping.com/api/ping/backup-daily?s=ok', { method: 'POST' }).end(); } catch (error) { const msg = encodeURIComponent(error.message); https.request(`https://deadmanping.com/api/ping/backup-daily?s=fail&m=${msg}`, { method: 'POST' }).end(); process.exit(1); }}Docker Containers
For containerized cron jobs, use the same approach. The container just needs network access:
0 3 * * * docker run --rm your-backup-image && \ curl -X POST "https://deadmanping.com/api/ping/backup-daily"What to Monitor
Prioritize monitoring jobs that have business impact:
- Database backups - Missing backups can mean data loss
- Data sync jobs - Broken syncs cause inconsistent state
- Report generation - Missing reports affect business operations
- Cleanup jobs - Disk space issues can cascade
- Health checks - Automated system health verification
Cron Notification System: Get Alerts When Jobs Fail
A reliable cron notification system is essential for detecting when your scheduled tasks stop working. If your cron job is not working, you need immediate notifications. Our cron job notification service sends alerts via email, Slack, or Discord when your cron job fails or doesn't run as expected.
The cron notification alert works by monitoring whether your job pings the service within the expected time window. If the cron notification is not working (meaning your job didn't ping), you'll receive an alert. This cron notification when job fails ensures you're always aware of issues before they become critical problems.
Setting up cron notification if job fails is simple: just add a curl command to your cron job. The cron notification if is not working will automatically trigger if your job doesn't complete successfully. This proactive approach to monitor cron notification helps you catch failures immediately, not days later.
Get Started in 2 Minutes
DeadManPing provides dead man switch monitoring for cron jobs. No complex setup, no agents to install. Just add a curl command to your cron job.
Start Monitoring Free