OpsVault

Storage

Upload backups to remote storage via rclone.

OpsVault uses rclone to upload backup files to remote storage. Any storage backend that rclone supports is compatible — Google Drive, Amazon S3, Backblaze B2, Dropbox, SFTP, and many others.

Configuration

storage:
  rclone:
    enabled: true
    remote: "gdrive"                              # Name of the configured rclone remote
    path: "opsvault/{hostname}/{name}/{date}"     # Path template on the remote
    rclone_config: ""                             # Custom rclone.conf path (empty = default)
    extra_args: ""                                # Extra args passed to `rclone copy`
    delete_after_upload: false                    # Remove local file after successful upload

Fields

remote

The name of a remote you have configured with rclone config. Run rclone listremotes to see your configured remotes.

path

A path template on the remote. The following variables are substituted at runtime:

VariableValue
{hostname}Server hostname (hostname command output)
{name}Database name from the config
{date}Date of the backup in YYYY-MM-DD format

Examples:

path: "opsvault/{hostname}/{name}/{date}"
# → gdrive:opsvault/web-01/myapp/2024-01-15/

path: "backups/{name}"
# → gdrive:backups/myapp/

path: "servers/{hostname}/db/{name}"
# → gdrive:servers/web-01/db/myapp/

delete_after_upload

When true, the local .sql.gz file is deleted after a successful upload. Use this if disk space is limited and you rely entirely on the remote copy.

If delete_after_upload is true and the upload fails, the local file is kept. But if the upload succeeds and then the remote file is corrupted, you will have no local copy. Consider keeping local copies for at least a few days.

rclone_config

Path to a custom rclone.conf file. Leave empty to use the default location (~/.config/rclone/rclone.conf or the path in $RCLONE_CONFIG).

Useful when running as root with a non-root rclone config:

rclone_config: "/home/youruser/.config/rclone/rclone.conf"

extra_args

Additional flags passed verbatim to rclone copy. For example:

extra_args: "--transfers 4 --bwlimit 10M"

Examples

storage:
  rclone:
    enabled: true
    remote: "gdrive"
    path: "opsvault/{hostname}/{name}"
storage:
  rclone:
    enabled: true
    remote: "s3backup"
    path: "my-backup-bucket/{hostname}/{name}"
storage:
  rclone:
    enabled: true
    remote: "b2"
    path: "my-b2-bucket/db-backups/{name}"
storage:
  rclone:
    enabled: true
    remote: "myserver-sftp"
    path: "/backups/{hostname}/{name}"

Disable remote storage

Set enabled: false to keep backups only on the local server:

storage:
  rclone:
    enabled: false

For rclone setup instructions, see the rclone setup guide.

On this page