Command Line Interface¶
A command line interface is used to backup and restore the databases.
For a one time backup the backup
subcommand is used,
to run it as a cron job the backup-cron
subcommand is used.
Usually the cron job is started as docker compose service,
which is the default entry point.
The documented arguments can be used either in command
or environment
section.
db-backup-runner¶
Main command to backup and restore databases.
Usage:
Options:
-v, --verbose Enable verbose output. [env var: DB_BACKUP_VERBOSE]
--help Show this message and exit.
Subcommands
- backup: Run a manual backup.
- backup-cron: Run backup based on the schedule.
- restore: Restore a backup for a specific container.
db-backup-runner backup¶
Run a manual backup.
Usage:
Options:
-c, --compression [gzip|lzma|xz|bz2|plain]
Compression algorithm. [env var:
DB_BACKUP_COMPRESSION; default: plain]
-p, --project TEXT Project name, used if it is not started with
docker compose. [env var:
DB_BACKUP_PROJECT_NAME]
-b, --backup-dir TEXT Backup directory. [env var: DB_BACKUP_DIR;
default: /tmp/db_backup_runner]
-t, --use-timestamp Add a timestamp to the backup filename.
[env var: DB_BACKUP_USE_TIMESTAMP]
-w, --webhook TEXT Heartbeat webhook address. [env var:
DB_BACKUP_WEBHOOK]
-g, --global Run in global mode, backup any container
(e.g. not just the one defined in
'project'.). [env var: DB_BACKUP_GLOBAL]
--help Show this message and exit.
db-backup-runner backup-cron¶
Run backup based on the schedule.
Usage:
Options:
-c, --cron TEXT Cron schedule (https://crontab.guru), per
default it runs at 2am every day. [env var:
DB_BACKUP_CRON; default: 0 2 * * *]
-o, --on-startup Run backup on startup as well. [env var:
DB_BACKUP_ON_STARTUP]
-c, --compression [gzip|lzma|xz|bz2|plain]
Compression algorithm. [env var:
DB_BACKUP_COMPRESSION; default: plain]
-p, --project TEXT Project name, used if it is not started with
docker compose. [env var:
DB_BACKUP_PROJECT_NAME]
-b, --backup-dir TEXT Backup directory. [env var: DB_BACKUP_DIR;
default: /tmp/db_backup_runner]
-t, --use-timestamp Add a timestamp to the backup filename.
[env var: DB_BACKUP_USE_TIMESTAMP]
-w, --webhook TEXT Heartbeat webhook address. [env var:
DB_BACKUP_WEBHOOK]
-g, --global Run in global mode, backup any container
(e.g. not just the one defined in
'project'.). [env var: DB_BACKUP_GLOBAL]
--help Show this message and exit.
db-backup-runner restore¶
Restore a backup for a specific container.
Usage:
Options: