Configuration
Overview of the OpsVault configuration file.
OpsVault is configured through a single YAML file, by default at /etc/opsvault/config.yaml.
Create the file
opsvault config init # writes /etc/opsvault/config.yaml
opsvault config validate # check for errorsTop-level fields
version: 1 # config format version, always 1
backup_dir: /var/backups/opsvault # where .sql.gz files are stored locally
schedule: "0 2 * * *" # cron expression for automatic backups
log_level: info # debug | info | warn | error
log_format: json # json (for systemd) | text (for terminal)Schedule format
Standard 5-field cron:
┌─ minute (0–59)
│ ┌─ hour (0–23)
│ │ ┌─ day of month (1–31)
│ │ │ ┌─ month (1–12)
│ │ │ │ ┌─ day of week (0–7, 0 and 7 = Sunday)
│ │ │ │ │
0 2 * * * every day at 02:00
0 */6 * * * every 6 hours
30 3 * * 0 every Sunday at 03:30
0 1 * * 1-5 weekdays at 01:00Log format
| Value | When to use |
|---|---|
json | Default. Structured output consumed by journald / log aggregators. |
text | Human-readable colored output. Auto-selected when a TTY is detected. |
Sections
Databases
MySQL and PostgreSQL connection settings.
Storage
rclone remote upload configuration.
Retention
Automatic cleanup of old backup files.
Notifications
Telegram and email alert settings.
Full example
version: 1
backup_dir: /var/backups/opsvault
schedule: "0 2 * * *"
log_level: info
log_format: json
databases:
- name: myapp_prod
type: postgres
host: 127.0.0.1
port: 5432
user: backup_user
password_env: DB_PASS
database: myapp
enabled: true
storage:
rclone:
enabled: true
remote: "gdrive"
path: "opsvault/{hostname}/{name}/{date}"
delete_after_upload: false
retention:
local:
enabled: true
keep_last: 7
keep_days: 30
remote:
enabled: true
keep_last: 0
keep_days: 90
notifications:
on_success: true
on_failure: true
telegram:
enabled: true
bot_token_env: TELEGRAM_TOKEN
chat_id: "123456789"
email:
enabled: false