cronhq
Backups

Daily database backup to S3

Trigger a nightly pg_dump or mysqldump and push the archive to S3 / R2.

Use this template →schedule: 0 3 * * *

Why this exists

Schedule a nightly backup job that hits an endpoint on your server, runs a database dump, and ships the compressed archive to S3-compatible object storage. Exactly-once guarantees mean you'll never accidentally run two dumps on top of each other.

Every production database needs offsite backups. This template gives you a hands-off nightly snapshot with retries, alerting if the backup fails, and history you can audit.

When to use it

  • You run Postgres, MySQL, MongoDB, or any DB on a VPS / container
  • You don't want to depend on a managed-DB vendor's backup pricing
  • You want a single audit log of every successful and failed backup

Common variations

  • Run twice a day (every 12h) for higher RPO
  • Different schedules per environment — daily prod, weekly staging
  • Add a verify step that downloads + checksums the archive

Setup in 4 steps

  1. 01Deploy a small endpoint on your server (e.g., /internal/backup) that runs pg_dump and uploads to S3 — see github.com/cronhq for example scripts
  2. 02Protect the endpoint with a shared secret in the Authorization header
  3. 03Use this template — Cronhq will POST to that endpoint at 03:00 UTC nightly
  4. 04Hook up Slack alerts so you're paged if a backup ever fails

Template configuration

Name
nightly-db-backup
Schedule
0 3 * * *
Method
POST
Timeout
300s
Max retries
2
Retry delay
600s

Webhook URL

https://api.example.com/internal/backup

Body

{
  "database": "production",
  "retention_days": 30
}

Ready

Use this template in 30 seconds.

Sign in, edit the webhook URL and any secrets, hit create. The job is live on the next tick.

Use this template →