Know the night your database backup fails.
pg_dump, mysqldump and backup scripts fail quietly: a full disk, a changed password, a moved server. Runbell expects a ping after every backup and alerts you the first time one doesn’t arrive.
- Schedule
0 3 * * *every night at 03:00- Grace period
- 1 hour
- Alerts
- Email and Slack
What goes wrong without anyone noticing
- The disk fills up
- The dump stops halfway, the script exits, and the newest file in the bucket is a week old.
- A password changes
- The database password is rotated, and every backup after that fails with an error nobody reads.
- The server is replaced
- A new machine goes live without the old crontab, and the backups simply stop.
Set it up
-
Create a check
Use the schedule
0 3 * * *and a grace period of 1 hour, in the time zone the job runs in. -
Add the ping
Ping at the start and send the exit code at the end. A failed dump then alerts you at once.
-
Choose who hears about it
Connect email, Slack, Telegram, SMS or any of the other channels to the project.
/opt/backup.sh
#!/bin/sh
URL=https://runbell.app/ping/your-check-id
curl -fsS -m 10 --retry 5 "$URL/start"
pg_dump -Fc shop > /backups/shop.dump && aws s3 cp /backups/shop.dump s3://my-backups/
curl -fsS -m 10 --retry 5 "$URL/$?"
Tips
- Send the exit code with
/$?so a failed backup alerts you straight away, not after the grace period. - The
/startping shows how long each backup takes, and catches one that hangs. - Send the end of the log with the ping (
curl --data-binary @backup.log) and read it in the event log.
Questions
Does Runbell see or store my backups?
No. It only receives the ping, and the log text if you choose to send it. Your backups stay where they are.
What if the backup runs but the file is empty?
Check the file size in the script and ping /fail when it is too small. Runbell alerts you straight away.
Other jobs to watch
- crontab Linux cron jobs An alert when a crontab job is late, missing or fails.
- PowerShell Windows Task Scheduler Know when a scheduled task didn’t run or failed.
- batch/v1 Kubernetes CronJobs Catch the CronJob that never started a pod.
- ETL, Airflow, reports ETL and reports Hear about the pipeline that didn’t finish before the morning meeting.
- certbot, ACME Certificate renewal Find out before an expired certificate does.