Backup Service
The backup service can be used to back up your bot configuration, the database and whatever you want to back up from your servers. It runs on a configurable schedule or can be launched by commands from the Backup plugin.
Configuration
To activate the backup service, you need to add a line in your main.yaml like so:
# config/main.yaml
opt_plugins:
- backup
The backup service itself can be configured with a yaml file /config/services/backup.yaml, that you might need to create. A sample is in the ./samples directory.
# config/services/backup.yaml
target: G:\My Drive\Backup # A directory of your choice, best case on a cloud drive
delete_after: never # Delete the files after x days (never = never)
backups:
database: # Backup your database
username: postgres # Optional: use a different user to back up the database
password: secret # Optional: password of that user
path: C:\Program Files\PostgreSQL\17\bin # Optional: path to your bin directory of your postgres database (will be auto-detected otherwise)
schedule:
times:
- 03:00 # do it every day at 03:00 LT
days: YYYYYYY
servers: # Backup your DCS servers
directories: # List of directories to be backed up
- Config
- Missions/Scripts # only back up this subdirectory
- Scripts
schedule:
times:
- 04:00 # do it every Sunday at 04:00 LT
days: NNNNNNY
bot: # Backup of your DCSServerBots configuration
directories: # directories to chose from
- config
- reports
schedule:
times: # Every night at 03:10 LT
- 03:10
days: YYYYYYY
Note
The backup service can't do incremental backups yet. So keep that in mind before you fill up your disk.
Configuration reference
| Key | Type | Description | Example |
|---|---|---|---|
target |
str | Directory the backup archives are written to. (range: min 1) | G:\My Drive\Backup |
delete_after |
text | Delete backup folders older than this many days, or never. | never |
backups |
map | The database, servers and bot backup jobs. | database: |
backups
| Key | Type | Description | Example |
|---|---|---|---|
backups.database |
map | Backup of the DCSSB PostgreSQL database. | username: postgres |
backups.database.path |
str | PostgreSQL bin directory holding pg_dump. (range: min 1) | C:\Program Files\PostgreSQL\17\bin |
backups.database.username |
str | Database user the backup connects as. (range: min 1) | postgres |
backups.database.password |
str | Password of that user; moved to the secret store. | *** |
backups.database.schedule |
map | When the database backup runs. | times: |
backups.database.schedule.times |
list | Times of day the backup runs, in local time. | - '03:00' |
backups.database.schedule.days |
str | Seven flags (Mo..Su) marking the days the job runs. (range: min 1) | YYYYYYY |
backups.servers |
map | Backup of every local DCS server's directories. | directories: |
backups.servers.directories |
list | Server sub-directories that are zipped into the backup. | - Config |
backups.servers.schedule |
map | When the server backup runs. | times: |
backups.servers.schedule.times |
list | Times of day the backup runs, in local time. | - '02:00' |
backups.servers.schedule.days |
str | Seven flags (Mo..Su) marking the days the job runs. (range: min 1) | NYYYYYN |
backups.bot |
map | Backup of the bot's own configuration and reports. | directories: |
backups.bot.directories |
list | Bot directories that are zipped into the backup. | - config |
backups.bot.schedule |
map | When the bot backup runs. | times: |
backups.bot.schedule.times |
list | Times of day the backup runs, in local time. | - '00:00' |
backups.bot.schedule.days |
str | Seven flags (Mo..Su) marking the days the job runs. (range: min 1) | YYYYYYY |