So I just built a simple version of what @vincent suggested. An image that can be run and told to do backups.
docker run --link rancher-server-container-id:db rancher-backup (OK, it isn’t called rancher-backup because I haven’t pushed it out yet, and it would have a real namespace)
It takes 4 env var options:
DB_DUMP_FREQ: how often to run the dump (minutes), default to 1440 (1/day)
DB_DUMP_BEGIN: when to start that frequency, in time of day, e.g. 1330, default 2330
DB_DUMP_TARGET: where to dump the backups, default to
DB_DUMP_DEBUG: to enable
set -x on the bash script that does the backups for debugging
So you could map something into
/backup and have it run the backups.
Each backup is saved as a file in
DB_DUMP_TARGET directory as a gzipped file with the name
rancher_backup_YYYYMMDDHHMMSS.gz (as in YYYY=year, etc.)
I am working on getting it to accept a
DB_DUMP_TARGET of an smb URL, then http and maybe nfs.
It also supports
DB_RESTORE_TARGET which, if given a file from a previous backup, will restore the database. Works really nicely as a one-time
docker run command.
Any interest? Should I ask my client for permission to open-source it?