docker-mysqldump
a simple mysqldump image for mysql mackup | dockerhub: uuz233/mysqldump
Arguments
Key | Accept value | Description | Required |
---|---|---|---|
DB_USER | String | The user for mysql connection | True |
DB_PASS | String | The password for connect db | True |
DB_NAME | String | Name of database that want to backup | True [if missing ALLSERVER_BACKUP arg] |
ALLSERVER_BACKUP | True/False | backup the hole mysql server | True [if missing DB_NAME arg] |
OTHER_ARG | String | other argument that you want to add | false |
SLEEP | INT (second) | The time to want for doing next backup | true |
example
Backup a single database
docker run --rm \
-e DB_HOST=mariadb-master-1 \
-e DB_USER=root \
-e DB_PASS=pass \
-e DB_NAME=db1 \
-e SLEEP=3600 \
-v ./backups:/backups
uuz233/mysqldump
Connect to DB root@mariadb-master-1 using password pass for backup db db1 and save the SQL file to ./backups
backup the hole server
docker run --rm \
-e DB_HOST=mariadb-master-1 \
-e DB_USER=root \
-e DB_PASS=pass \
-e ALLSERVER_BACKUP=true \
-e SLEEP=3600 \
-v ./backups:/backups
uuz233/mysqldump
Connect to DB root@mariadb-master-1 using password pass for backup the hole server and save the SQL file to ./backups
backup with other arguments
docker run --rm \
-e DB_HOST=mariadb-master-1 \
-e DB_USER=root \
-e DB_PASS=pass \
-e ALLSERVER_BACKUP=true \
-e OTHER_ARG=--lock-tables=0 \
-e SLEEP=3600 \
-v ./backups:/backups
uuz233/mysqldump
Connect to DB root@mariadb-master-1 using password pass for backup the hole server and save the SQL file to ./backups. Using the arg --lock-tables=0
Contribute
Welcome to contribute to this project in any way(pr,issues,etc.)
Licence
This project is under GPLv3