mysqldump a database and push it to Microsoft Azure Blob Storage on a schedule you define
2.0K
===========================================
mysql-azcopy is a container which uses mysqldump to backup a database and schedules a go-cron task which uses azcopy to upload the backup to Azure Blob Storage
At some point in the future, it will do more, and cooler, things
mysql-azcopy needs to know the IP/hostname, mysql user, mysql password, mysql port, azure storage account name, azure blob container name, azure destination key, azure directory, and go-cron container schedule.
This can be done through environment variables:
FILE_PREFIX <-- Defaults to 'backup' - used in naming the fileMYSQL_USERMYSQL_PASSMYSQL_HOST <-- Defaults to 'mysql'MYSQL_PORT <-- Defaults to '3306'MYSQL_DB_NAME <-- Name of the database you would like to back upAZURE_DST_KEY <-- Access key for your Azure Blob Storage AccountAZURE_STORAGE_ACCT_NAME <-- Name of your Azure Blob Storage AccountAZURE_BLOB_CONTAINER <-- Name of container holding your blobsAZURE_BLOB_DIRECTORY <-- Directory name to store files in inside of your blob containerThis command
sudo docker run -e FILE_PREFIX=production \
-e MYSQL_USER=db_user \
-e MYSQL_PASS=sekret_password \
-e MYSQL_HOST=192.168.89.153 \
-e MYSQL_PORT=3306 \
-e MYSQL_DB_NAME=wordpress_site \
-e AZURE_DST_KEY=AZURE_ACCT_KEY \
-e AZURE_STORAGE_ACCT_NAME=mystorage \
-e AZURE_BLOB_CONTAINER=mysql-backups \
-e CRON_SCHEDULE="@every 5m30s" \
-e AZURE_BLOB_DIRECTORY=wordpressbackups \
intlfcstone/mysql-azcopy:v0.0.1
Connects to a MySQL database located at 192.168.89.153 authenticating with the credentials db_user/sekret_password
and dumps the database wordpress_site to a file called production-wordpress_site_2018-10-01-at-09_19PM.sql (example date)
which is then gzipped and pushed to the directory wordpressbackups, inside the container mysql-backups,
inside the storage account mystorage, authenticating to Azure blob storage with AZURE_ACCT_KEY.
The backup process script in this example will run every 5 minutes and 30 seconds.
You can specify any frequency which go-cron can parse (@daily, @hourly, etc).
Content type
Image
Digest
Size
130.9 MB
Last updated
over 7 years ago
docker pull intlfcstone/mysql-azcopy