Backup Alerts Runbook¶
Overview¶
This runbook provides step-by-step troubleshooting procedures for all backup-related alerts in the infrastructure. Each alert includes immediate actions, investigation steps, and resolution procedures.
Alert Categories¶
| Alert Name | Severity | Type | SLA |
|---|---|---|---|
| CloudBackupMissing | Critical | Missing backup | 48 hours |
| InfrastructureBackupMissing | Critical | Missing backup | 48 hours |
| CloudBackupFailed | Critical | Backup failure | Immediate |
| InfrastructureBackupFailed | Critical | Backup failure | Immediate |
| BackupErrors | Warning | Error accumulation | 3 errors/24h |
| R2StorageHigh | Warning | Storage capacity | 80% usage |
| BackupDurationHigh | Warning | Performance | 2x normal duration |
CloudBackupMissing Alert¶
Alert Definition¶
alert: CloudBackupMissing
expr: time() - cloud_backup_last_run_timestamp > 172800 # 48 hours
for: 5m
labels:
severity: critical
service: backup
category: cloud
Immediate Actions (< 5 minutes)¶
-
Check Current Status
# Check last backup timestamp curl -s localhost:9100/metrics | grep cloud_backup_last_run_timestamp # Calculate hours since last backup last_backup=$(curl -s localhost:9100/metrics | grep cloud_backup_last_run_timestamp | awk '{print $2}') current=$(date +%s) hours_ago=$(( (current - last_backup) / 3600 )) echo "Last backup: $hours_ago hours ago" -
Verify Service Status
-
Check Cron Job Status
Investigation Steps (5-15 minutes)¶
-
Examine Backup Logs
-
Verify Cloud Service Connectivity
-
Check Wrapper Script Status
Resolution Procedures¶
If Cron Job Failed:
# Check crontab entry
crontab -l | grep backup
# Re-add missing cron entry if needed
echo "0 2 * * * /srv/dockerdata/rclone/backup-clouds-with-metrics.sh" | crontab -
# Restart cron service
systemctl restart cron
If Cloud Authentication Failed:
# Re-authenticate with cloud services
docker exec -it rclone rclone config
# Test authentication
docker exec rclone rclone about gdrive:
docker exec rclone rclone about onedrive:
If Hetzner Storage Issues:
# Check Hetzner connectivity
docker exec rclone rclone about hetzner:
# Verify storage box isn't full
docker exec rclone rclone size hetzner:/backups
# Check for network issues
docker exec rclone ping storage-box.de -c 3
Manual Recovery:
# Run backup manually to clear alert
/srv/dockerdata/rclone/backup-clouds-with-metrics.sh
# Verify metrics updated
cat /var/lib/node_exporter/textfile_collector/cloud_backup.prom
# Check alert status in Prometheus
curl -s 'localhost:9090/api/v1/query?query=cloud_backup_last_run_timestamp' | jq
InfrastructureBackupMissing Alert¶
Alert Definition¶
alert: InfrastructureBackupMissing
expr: time() - infrastructure_backup_last_run_timestamp > 172800 # 48 hours
for: 5m
labels:
severity: critical
service: backup
category: infrastructure
Immediate Actions (< 5 minutes)¶
-
Check Backup Status
-
Verify Critical Services
Investigation Steps (5-15 minutes)¶
-
Examine Infrastructure Backup Logs
-
Check Database Connectivity
-
Verify R2 Access
Resolution Procedures¶
If Database Backup Failed:
# Test manual database dump
docker exec supa-db pg_dumpall -U postgres > test-dump.sql
# Check dump file size and integrity
ls -lh test-dump.sql
head -20 test-dump.sql
rm test-dump.sql
If R2 Connection Failed:
# Check R2 credentials in environment
docker exec rclone printenv | grep -i cloudflare
# Test R2 connection
docker exec rclone rclone about cloudflare:
# Re-configure R2 if needed
docker exec -it rclone rclone config
If Storage Full:
# Clean old backups manually
docker exec rclone rclone delete cloudflare:infrastructure-backups \
--min-age 30d --dry-run # Remove --dry-run to execute
# Check space after cleanup
docker exec rclone rclone size cloudflare:infrastructure-backups
Manual Recovery:
# Run infrastructure backup manually
/srv/dockerdata/rclone/backup-infrastructure-with-metrics.sh
# Verify backup completed
docker exec rclone rclone lsl cloudflare:infrastructure-backups | tail -1
# Check updated metrics
cat /var/lib/node_exporter/textfile_collector/infrastructure_backup.prom
BackupErrors Alert¶
Alert Definition¶
alert: BackupErrors
expr: increase(cloud_backup_errors_total[24h]) > 3 or increase(infrastructure_backup_errors_total[24h]) > 3
for: 5m
labels:
severity: warning
service: backup
Investigation Steps¶
-
Identify Error Patterns
-
Categorize Errors
# Network errors grep -i "network\|timeout\|connection" /srv/dockerdata/rclone/backup*.log | tail -10 # Authentication errors grep -i "auth\|token\|permission\|forbidden" /srv/dockerdata/rclone/backup*.log | tail -10 # Storage errors grep -i "space\|quota\|full" /srv/dockerdata/rclone/backup*.log | tail -10
Resolution Based on Error Type¶
Network/Timeout Errors:
# Test connectivity
docker exec rclone ping google.com -c 3
docker exec rclone ping storage-box.de -c 3
# Check network interface
ip route show
Authentication Errors:
# Re-authenticate services
docker exec -it rclone rclone config
# Check token expiration
docker exec rclone rclone config show | grep token
Storage Capacity Errors:
# Check local disk space
df -h /srv/dockerdata
df -h /srv/backups
# Check cloud storage quotas
docker exec rclone rclone about gdrive:
docker exec rclone rclone about hetzner:
R2StorageHigh Alert¶
Alert Definition¶
alert: R2StorageHigh
expr: infrastructure_backup_r2_usage_percentage > 80
for: 5m
labels:
severity: warning
service: backup
category: storage
Immediate Actions¶
-
Check Current Usage
-
Analyze Backup Growth
Resolution Steps¶
-
Clean Old Backups
-
Optimize Backup Size
-
Adjust Retention Policy
BackupDurationHigh Alert¶
Alert Definition¶
alert: BackupDurationHigh
expr: cloud_backup_duration_seconds > 14400 or infrastructure_backup_duration_seconds > 7200
for: 0m
labels:
severity: warning
service: backup
category: performance
Investigation Steps¶
-
Check Current Duration
# Get recent backup durations curl -s localhost:9100/metrics | grep backup_duration_seconds # Convert to hours for readability duration=$(curl -s localhost:9100/metrics | grep cloud_backup_duration_seconds | awk '{print $2}') echo "Last backup took: $(($duration / 3600)) hours $(($duration % 3600 / 60)) minutes" -
Analyze Performance Factors
-
Identify Bottlenecks
Optimization Actions¶
-
Optimize Rclone Settings
-
Exclude Large Non-Critical Files
-
Schedule Optimization
Common Backup Issues and Solutions¶
Issue: Backup Stuck/Hanging¶
Symptoms: - Backup process running for hours without completion - No progress in logs - High system load
Solution:
# Kill stuck backup process
pkill -f backup-clouds-with-metrics.sh
pkill -f backup-infrastructure-with-metrics.sh
# Clear any lock files
rm -f /tmp/backup-*.lock
# Check for zombie rclone processes
ps aux | grep rclone | grep -v grep
# Restart rclone service if needed
docker compose -f rclone/docker-compose.yml restart
Issue: Metrics Not Updating¶
Symptoms: - Backup runs successfully but metrics show old timestamps - Alert continues firing despite successful backup
Solution:
# Check textfile collector directory
ls -la /var/lib/node_exporter/textfile_collector/
# Check file permissions
chmod 644 /var/lib/node_exporter/textfile_collector/*.prom
# Verify metrics file content
cat /var/lib/node_exporter/textfile_collector/cloud_backup.prom
# Restart node exporter
docker compose -f monitoring/docker-compose.yml restart node-exporter
Issue: Authentication Expired¶
Symptoms: - "token expired" or "authentication failed" errors - Backup fails at cloud service connection
Solution:
# Re-run rclone config for affected service
docker exec -it rclone rclone config
# For Google Drive (browser-based auth):
# 1. Select existing config
# 2. Choose to edit
# 3. Accept all defaults
# 4. Complete browser authentication
# For OneDrive (similar process):
# Follow same steps but for OneDrive config
# Test authentication
docker exec rclone rclone lsd gdrive:
docker exec rclone rclone lsd onedrive:
Issue: Insufficient Storage Space¶
Symptoms: - "no space left on device" errors - Backup fails during file operations
Solution:
# Check disk usage
df -h
# Clean up old backups
find /srv/backups -name "*.tgz" -mtime +14 -delete
find /srv/backups -name "*.sql.gz" -mtime +14 -delete
# Clean Docker unused resources
docker system prune -f
# Clean log files
find /srv/dockerdata -name "*.log" -size +100M -exec truncate -s 10M {} \;
Escalation Procedures¶
Level 1: Automated Resolution¶
- Automatic retry logic in backup scripts (3 attempts)
- Temporary error tolerance (up to 3 errors per 24h)
- Self-healing for transient network issues
Level 2: Administrator Notification¶
- Trigger: Critical alerts (missing backups, failures)
- Channels: ntfy push notification, email alert
- Response Time: 4 hours during business hours, 24 hours otherwise
Level 3: Emergency Response¶
- Trigger: Data loss risk, multiple backup failures
- Actions:
- Immediate manual backup execution
- Alternative backup strategy activation
- Infrastructure health assessment
Emergency Contact Information¶
Primary Administrator:
- ntfy topic: backup-critical-failure
- Email: configured in AlertManager
- Response SLA: 4 hours
Backup Recovery Team: - Available during critical data loss scenarios - Access to all backup credentials and procedures - Authority to implement emergency recovery procedures
Prevention and Maintenance¶
Daily Checks¶
Weekly Reviews¶
- Review backup success rates in Grafana
- Check storage growth trends
- Verify alert rule effectiveness
- Test random restore procedures
Monthly Tasks¶
- Full disaster recovery test
- Backup strategy review
- Performance optimization assessment
- Documentation updates
Quarterly Assessments¶
- Backup retention policy review
- Storage cost optimization
- Recovery time objective validation
- Technology stack updates
Related Documentation¶
- Backup Metrics Implementation - Technical implementation details
- Backup Strategy Guide - Overall backup architecture
- Grafana Dashboard Configuration - Dashboard management
- Prometheus Alert Configuration - Alert rule management