Monitor Cron Jobs: One Curl Line, No Migration
Keep your cron and scripts. Add one curl line—no SDK, no migration. Get alerts when jobs fail or stop running. Free tier, 2-min setup.
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 solutions 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.
Backup Monitoring Use Case
One of the most common use cases for cron monitoring is backup monitoring. Backups are critical, but they often fail silently. Your backup script might run, but produce an empty file (0 bytes), or the backup might not run at all due to cron being disabled.
Dead man switch monitoring is perfect for backups because:
- Detects empty backup files - Validates backup file size using payload validation
- Detects missing backups - Alerts if backup doesn't run within expected interval
- Works with any backup method - rsync, tar, database dumps, cloud sync, etc.
- No infrastructure required - Perfect for VPS, bare metal, or legacy servers without Kubernetes/Prometheus
Learn more about backup dead man switch monitoring or how to detect empty backup files.
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 end
curl -X POST "https://deadmanping.com/api/ping/backup-daily"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.
Including Data from Execution
You can include data from execution using query parameters. Set validation rules in the DeadManPing panel to check these values:
#!/bin/bash
./backup.sh
EXIT_CODE=$?
BACKUP_SIZE=$(du -sh /backups/latest | cut -f1)
# Single ping with data from execution
# In DeadManPing panel: set validation rules:
# - "exit_code" == 0
# - "backup_size" contains expected pattern
curl -X POST "https://deadmanping.com/api/ping/backup-daily?exit_code=$EXIT_CODE&backup_size=$BACKUP_SIZE"Language-Specific Examples
Python
import requests
import sys
# Your backup logic here
run_backup()
# Single ping at end - if job fails, ping won't arrive and DeadManPing will alert
requests.post("https://deadmanping.com/api/ping/backup-daily")Node.js
const https = require('https');
async function runBackup() {
await performBackup();
// Single ping at end - if job fails, ping won't arrive and DeadManPing will alert
https.request('https://deadmanping.com/api/ping/backup-daily', { method: 'POST' }).end();
}
runBackup().catch((err) => {
// If job fails, ping won't arrive - DeadManPing will detect missing ping
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.
Related Articles
Learn more about cron job monitoring and troubleshooting:
Cron Monitoring Without SDK: One Curl Line
Monitor cron jobs with one curl line. No SDK, no agent, no migration.
Cron Job Failed? How to Detect & Fix in 5 Min
Step-by-step guide to detect why your cron failed, fix it, and get alerts so it never happens again.
Dead Man Switch for Backups
Implement dead man switch monitoring for backup jobs to detect failures immediately.
Verify Cron Job Actually Ran
How to verify that cron jobs actually executed with timestamps and pings.
Silent Cron Failures: How to Detect Them
Detect silent cron job failures that don't log errors.