{% extends "admin/dbs/wiki/_layout.html" %} {% block wiki %}

Scheduled backups

Open Schedule, tick enabled, and choose how often (30m, 6h, 1d) and how many backups to keep in DBS_BACKUP_DIR. Backups stay on this server; the DBS manager takes the off-site copies by connecting to this server and pulling them.

The schedule runs inside your web workers. Each worker starts a small background thread on the first request it serves, and the thread checks once a minute whether a backup is due. A lease in the database lets exactly one of them take each backup, and only one backup or restore runs at a time. The lease lasts two minutes and is renewed while the backup runs, so a long backup is never started twice. If a worker dies mid-backup, its audit row is marked interrupted and the next tick takes the backup again; if that one dies too, the schedule waits for the next interval.

Choosing where it runs

Health shows when the scheduler last checked in and whether the last backup is on time.

What is kept

The server keeps at most five backups in DBS_BACKUP_DIR; the schedule keeps between one and five. After each backup, retention removes the oldest of this project's backups beyond that number, and only those:

Unfinished temporary files older than an hour are cleared from the folder.

A fixed plan from the command line

Flags still run their own plan, ignoring the panel:

python manage.py dbs schedule --interval 6h --output-dir /var/backups --keep 5

SIGTERM stops the loop at once, and --once runs a single cycle from cron. DBS_SCHEDULE_INTERVAL and DBS_SCHEDULE_KEEP seed the panel's first schedule and supply the defaults for these flags.

{% endblock %}