Skip to content

Configuration Reference

Configuration lives in /etc/s3dbbackup/config.json (created by the setup wizard, mode 600). You normally never edit it by hand — re-run sudo s3dbbackup setup to change anything — but every field is documented here.

Full example

json
{
  "version": 1,
  "s3": {
    "endpoint": "https://<account>.r2.cloudflarestorage.com",
    "access_key_id": "AKIA...",
    "secret_access_key": "********",
    "bucket": "my-vps-backups",
    "region": "auto",
    "prefix": "s3dbbackup",
    "use_path_style": true
  },
  "databases": [
    { "type": "postgresql", "name": "app_production" },
    { "type": "mysql", "name": "wordpress", "host": "localhost", "port": 3306, "user": "root", "password": "********" }
  ],
  "schedule": { "frequency_label": "Every day (midnight)", "oncalendar": "daily" },
  "retention": { "max_copies": 7 },
  "local": { "enabled": true, "path": "/var/backups/s3dbbackup" },
  "notifications": {
    "enabled": true,
    "webhook_url": "https://discord.com/api/webhooks/...",
    "events": ["trigger", "success", "failure", "error"]
  }
}

s3 — storage connection

KeyTypeDefaultWhat it doesWhen to change
endpointstring""S3 API endpoint URL. Empty = AWS S3.Set for R2/MinIO/Spaces/B2/Wasabi.
access_key_idstringAccess key.When rotating keys.
secret_access_keystringSecret key (stored locally, never sent anywhere but S3).When rotating keys.
bucketstringBucket that holds the backups.If you move buckets.
regionstringus-east-1Signing region. R2 = auto; Spaces = datacenter (e.g. sgp1).Match your provider.
prefixstrings3dbbackupFolder all objects live under. Keeps backups separate from other data.To share a bucket with other data.
use_path_stylebooltruePath-style addressing (endpoint/bucket/key).On for non-AWS; off for AWS.

Common mistake

For Cloudflare R2, MinIO, DigitalOcean Spaces and most non-AWS providers, use_path_style must be true. Leaving it off is the most common cause of connection or upload errors.

databases — what to back up

An array of objects. Minimum fields are type and name; credential fields are optional and only used when the dump can't authenticate via the local socket.

KeyTypeDefaultWhat it does
typestringpostgresql or mysql (MariaDB uses mysql).
namestringThe database name.
hoststringlocalhostDB host.
portint5432 / 3306DB port.
userstringpostgres / rootDB user used for the dump.
passwordstring""DB password. Omit to use peer/socket auth.

TIP

For PostgreSQL with peer auth, leaving credentials empty lets the tool dump via the local postgres user. For MySQL/MariaDB, an empty password uses local socket auth as the configured user.

schedule — how often it runs

KeyTypeDefaultWhat it does
frequency_labelstringdailyHuman label shown in status.
oncalendarstringdailyThe systemd OnCalendar= expression that drives the timer.

Common oncalendar values:

Frequencyoncalendar
Hourlyhourly
Every 6 hours*-*-* 00/6:00:00
Every 12 hours*-*-* 00/12:00:00
Daily (midnight)daily
Weekly (Sunday)weekly

retention — how many copies to keep

KeyTypeDefaultWhat it does
max_copiesint7Keep the newest N backups per database. On the N+1th backup the oldest is deleted from S3 and from the local copy. 0 = keep everything.

local — on-node copies

KeyTypeDefaultWhat it does
enabledbooltrueAlso store a copy on the server.
pathstring/var/backups/s3dbbackupWhere local copies live (organised as path/<type>/<name>/).

notifications — Discord alerts

KeyTypeDefaultWhat it does
enabledboolfalseMaster switch.
webhook_urlstring""Discord-compatible webhook URL.
eventsarray["failure","error"]Which events to send: trigger, success, failure, error.

See Discord Webhooks for what each event looks like.

Files & locations

PathPurpose
/etc/s3dbbackup/config.jsonThis configuration (mode 600).
/etc/s3dbbackup/state.jsonLast-run timestamp and failure count.
/opt/s3dbbackup/Program + virtualenv.
/usr/local/bin/s3dbbackupThe command.
/etc/systemd/system/s3dbbackup.{service,timer}The schedule.
/var/backups/s3dbbackup/On-node copies (configurable).
/tmp/s3dbbackup/Temporary dump files (deleted after each run).