Skip to content

plenus-cloud/backup-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plenus Platform Logo

backup-mysql

Docker container for mysql backup

Usage

Docker

# run every hour command mysqldump --all-databases, mysql is at mysqlhostname:3306
docker run -d -e SCHEDULE="* */1 * * *" -e MYSQLPASSWORD=mysecretpassword -e MYSQLHOST=mysqlhostname -e MYSQLUSER=root --name mysql-backup plenus/backup-mysql

# run every hour command mysqldump for database MYSQLDB,  mysql is at mysqlhostname:33060
docker run -d -e SCHEDULE="* */1 * * *" -e MYSQLPASSWORD=mysecretpassword -e MYSQLHOST=mysqlhostname -e MYSQLPORT=33060 -e MYSQLUSER=dbuser -e MYSQLDB=dbname --name mysql-backup plenus/backup-mysql

# use ADDITIONALPARAMS to exclude two tables from backup
docker run -d -e SCHEDULE="* */1 * * *" -e MYSQLPASSWORD=mysecretpassword -e MYSQLHOST=mysqlhostname -e MYSQLPORT=33060 -e MYSQLUSER=dbuser -e MYSQLDB=dbname ADDITIONALPARAMS='--ignore-table=db1.foo --ignore-table=db2.bar' --name mysql-backup plenus/backup-mysql

Variables

SCHEDULE: schedule for backup, in cron format MYSQLPASSWORD: password for MYSQLUSER MYSQLUSER: mysql user to be used for backup MYSQLDB: host name for mysql MYSQLPORT: port for mysql SKIPLOCK: set to 1 or true to add --skip-lock-tables to mysqldump ADDITIONALPARAMS: additional parameters passed to mysqldump

Backup location

dump is created in file /dump/mysql.sql.gz (compressed with gzip).

About

Docker container for mysql backup

Resources

License

Stars

Watchers

Forks

Packages

No packages published