Monitor Your Database Backup Cron Job

Backups are the canonical silent-failure job: cron still runs, disk fills, credentials rotate, and nobody notices until restore time. A success ping after a real backup proves the pipeline completed.

General cron context: cron job monitoring · silent failures

The problem

pg_dump fails, S3 upload fails, or the job stops being scheduled — email-to-root is easy to ignore. CronCraft alerts when the ping does not arrive.

Copy-paste pattern (PostgreSQL)

#!/bin/bash
# backup.sh — nightly
set -euo pipefail
pg_dump mydb | gzip > /backup/db-$(date +%F).sql.gz
aws s3 cp /backup/db-$(date +%F).sql.gz s3://my-bucket/backups/

curl -fsS --retry 3 https://croncraft.app/ping/YOUR_TOKEN > /dev/null

If it fails

Either the script exits non-zero before curl (no ping → late alert) or you call /ping/TOKEN/fail from an error trap. See README for failure endpoint details.

Register a job whose schedule matches crontab.

Start monitoring