Dead Man Switch for Backups: 1 Curl, Instant Alerts
One curl line—instant alerts when your backup doesn't run or fails. No agent, no migration.
Your backup script runs as before. Just add one curl line at the end.
Why Backup Monitoring Matters
Backups are your last line of defense against data loss. But if your backup job fails silently, you're left with false confidence. Common backup failure scenarios:
- Disk space runs out mid-backup
- Database connection fails during dump
- Network issues when syncing to remote storage
- Permission errors after system updates
- Backup script crashes due to unhandled errors
- Cron job gets disabled or removed
Traditional monitoring checks if files exist, but doesn't verify they're recent or complete. A dead man switch confirms the backup process actually ran.
How Dead Man Switch Works for Backups
DeadManPing doesn't run your backups. Your cron does. DeadManPing only observes if the ping arrived.
After each successful backup, your script pings a monitoring service. If the ping doesn't arrive within the expected interval (e.g., daily backups should ping every 24 hours), you get an alert. It's independent of your backup infrastructure, so it works with any backup method.
Important: The curl command must be inside your backup script, not in the cron line, because only in the script do you have access to variables from execution results (e.g., backup file size, success status).
rsync Backup Example
#!/bin/bash
set -e
# Run backup
rsync -avz /data/ user@backup-server:/backups/
# Single ping at end - if job fails, ping won't arrive and DeadManPing will alert
curl -X POST "https://deadmanping.com/api/ping/backup-daily"The set -e ensures the script exits on any error, so the ping only happens if rsync succeeds.
Database Backup Example
#!/bin/bash
BACKUP_FILE="/backups/db-$(date +%Y%m%d).sql"
pg_dump mydb > "$BACKUP_FILE"
gzip "$BACKUP_FILE"
# Get backup file size
FILE_SIZE=$(stat -f%z "$BACKUP_FILE.gz" 2>/dev/null || stat -c%s "$BACKUP_FILE.gz" 2>/dev/null || echo 0)
# Single ping with file size in payload
# In DeadManPing panel: set validation rule "size" > 0
# Panel will automatically detect if backup file is empty
curl -X POST "https://deadmanping.com/api/ping/backup-db?size=$FILE_SIZE"Cloud Backup (S3, GCS, etc.)
#!/bin/bash
# Create backup archive
tar -czf backup.tar.gz /data/
# Upload to S3
aws s3 cp backup.tar.gz s3://my-bucket/backups/
UPLOAD_EXIT_CODE=$?
rm backup.tar.gz
# Single ping with upload exit code in payload
# In DeadManPing panel: set validation rule "upload_exit_code" == 0
# Panel will automatically detect if S3 upload failed
curl -X POST "https://deadmanping.com/api/ping/backup-s3?upload_exit_code=$UPLOAD_EXIT_CODE"What Makes a Good Backup Dead Man Switch
- Independent infrastructure - Runs outside your backup system, so it detects failures even if your monitoring is down
- Simple integration - Just add a curl command, no agents or complex setup
- Immediate alerts - Notifies you as soon as a backup is missed, not days later
- Works with any backup method - rsync, tar, database dumps, cloud sync, etc.
- Failure reporting - Can distinguish between "backup didn't run" and "backup failed"
Setting Up Monitoring Intervals
Match your monitoring interval to your backup frequency, with a grace period:
- Daily backups - Expect ping every 24 hours, alert if missing for 25+ hours
- Hourly backups - Expect ping every hour, alert if missing for 65+ minutes
- Weekly backups - Expect ping every 7 days, alert if missing for 8+ days
The grace period accounts for slight timing variations and gives you time to respond before it's critical.
Start Monitoring Your Backups Today
DeadManPing provides dead man switch monitoring for backup jobs. Set up monitoring in 2 minutes, works with any backup method, and sends alerts via email, Slack, or Discord.
Related Articles
Learn more about cron job monitoring and troubleshooting:
Backup Monitoring Service
Backup monitoring that doesn't touch your execution.
Detect Empty Backup File
How to detect when backup files are empty or zero bytes.
Verify Backup File Size
How to verify backup file sizes are within expected ranges.
Monitor Cron Jobs: One Curl Line, No Migration
Monitor cron jobs with one curl line. No SDK, no migration—get alerts when jobs fail.