{% extends "admin/dbs/wiki/_layout.html" %} {% block wiki %}
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.
DBS_SCHEDULER = "thread" (default): inside the web workers.DBS_SCHEDULER = "command": run python manage.py dbs schedule
under systemd. It follows the same panel setting. Use it behind uWSGI without
--enable-threads, or when several hosts each keep their own
DBS_BACKUP_DIR.DBS_SCHEDULER = "off": no scheduled backups from this project.Health shows when the scheduler last checked in and whether the last backup is on time.
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:
backup-YYYYMMDD-HHMMSSZ.dbs for the default database and
backup-ALIAS-YYYYMMDD-HHMMSSZ.dbs for any other, with
DBS_BACKUP_PREFIX in place of backup. Two backups taken in the
same second get -2, -3 and so on.Unfinished temporary files older than an hour are cleared from the folder.
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.