Sign inSign up

jarrance/mysql-backup

By jarrance

Updated over 6 years ago

mysql backup and dump

Image
0

2.4K

jarrance/mysql-backup repository overview

A utility used to backup a mysql container. Can also be used in Kubernetes to backup a MySQL pod.

Output files

All of the sql backup files will be stored in ~/mysqlbackup on the local system.

If you are running in a Docker container, a docker volume should be mounted in the user home directory. If not, the SQL dump files will not be saved.

To mount the config files into the Docker container use the -v option. The following command will store the files from the container in the users home directory in the directory mysqlbackup/.

docker run -v ~/mysqlbackup:/root/mysqlbackup

Docker - Pull the pre built image(coming soon) will not work

# docker pull mysql-backup

Docker - build container image from Dockerfile

# docker build -t mysql-backup .

or

# ./build-backup-container.sh

Docker - run container only

docker run --rm -v ~/mysqlbackup:/root/mysqlbackup -e SYSDIGCLOUD_MYSQL_SERVICE_HOST='192.168.1.26' -e SYSDIGCLOUD_MYSQL_SERVICE_PORT=3306 -e MYSQL_DATABASE='draios' -e MYSQL_PASSWORD='test' -e MYSQL_USER='test' -e FULLBACKUP=True -e KEEP=5 -e INTERVAL=10 -ti mysql-backup

or

# ./run-backup-container.sh

Docker - execute from within the container

# docker run --rm -v ~/mysqlbackup:/root/mysqlbackup -ti mysql-backup /bin/bash

Tag summary

Content type

Image

Digest

Size

96.3 MB

Last updated

over 6 years ago

docker pull jarrance/mysql-backup