Dead Man Switch for Backups: Never Miss a Failed Backup Again
Dead man switch that doesn't touch your execution.
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/bashset -e# Run backuprsync -avz /data/ user@backup-server:/backups/# Ping monitoring servicecurl -X POST "https://deadmanping.com/api/ping/backup-daily?s=ok"The set -e ensures the script exits on any error, so the ping only happens if rsync succeeds.
Database Backup Example
#!/bin/bashBACKUP_FILE="/backups/db-$(date +%Y%m%d).sql"if pg_dump mydb > "$BACKUP_FILE"; then gzip "$BACKUP_FILE" curl -X POST "https://deadmanping.com/api/ping/backup-db?s=ok"else curl -X POST "https://deadmanping.com/api/ping/backup-db?s=fail&m=pg_dump+failed" exit 1fiCloud Backup (S3, GCS, etc.)
#!/bin/bash# Create backup archivetar -czf backup.tar.gz /data/# Upload to S3if aws s3 cp backup.tar.gz s3://my-bucket/backups/; then rm backup.tar.gz curl -X POST "https://deadmanping.com/api/ping/backup-s3?s=ok"else curl -X POST "https://deadmanping.com/api/ping/backup-s3?s=fail&m=S3+upload+failed" exit 1fiWhat 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.
Start Free Trial