Dostic lets you backup all named Docker volumes into a restic repository and helps you to restore from it. It detects MariaDB and MongoDB volumes automatically and performs hot online backups using Mariabackup and mongodump.
Put password for restic repository in a file called
restic_password.Copy
dostic.conf.exampletodostic.confand adjust settings.If you want to use Rclone backend in restic, you should start the configuration wizard:
./dostic.sh configureInitialize restic repository and test connection:
./dostic.sh init
- Run:
./dostic.sh backup
List all restic snapshots:
./dostic.sh listRestore regular data volume:
./dostic.sh restore_volume <snapshot> <restic-directory> <volume-or-directory>Restore MariaDB volume:
./dostic.sh restore_mariadb <snapshot> <restic-xbstream> <mariadb-image> <volume-or-directory>Restore MongoDB volume:
./dostic.sh restore_mongodb <snapshot> <restic-mdb> <mongo-image> <volume-or-directory>
Backup all named Docker volumes (and host directories specified in
BACKUP_DIRS):Just execute:
./dostic.sh backup
Restore regular volume named
my_data:Create a new volume:
docker create volume restored_dataRestore data from latest snapshot:
./dostic.sh restore_volume latest my_data restored_data
Restore MariaDB data volume named
my_database:Create a new volume:
docker create volume restored_databaseRestore data from latest snapshot using MariaDB 10.3 Docker image:
./dostic.sh restore_mariadb latest my_database mariadb:10.3 restored_database
- The content of container labels
dostic.precmdanddostic.postcmdis executed usingdocker execbefore and after backup of associated volumes. E.g. adddostic.precmd=redis-cli saveto a redis container to ensure all data is written to disk before starting the backup. restic forgetis executed on sundays automatically using parameters provided inRESTIC_FORGET_ARGS.- Directories containing a file
.nobackupare ignored.