In this recipe we will learn how to store MySQL backups in Minio Server.
- Install mc from here.
- Install Minio Server from here.
- Know where the MySQL backups reside in the local filesystem.
Access credentials shown in this example belong to https://play.minio.io:9000. These credentials are open to public. Feel free to use this service for testing and development. Replace with your own Minio keys in deployment.
$ mc mb play/mysqlbkp
Bucket created successfully ‘play/mysqlbkp’.
$ mc mirror mysqlbkp/ play/mysqlbkp
The above recipe can be automated easily. Change the bash script below to your own directories and PATHS as needed. Set up a cron to run this task as needed.
#!/bin/bash
# Filename: minio-mysql-bkp.sh & has executable permissions.
LOCAL_BACKUP_PATH="/home/miniouser/mysqlbkp"
MINIO_BUCKET="play/mysqlbkp"
MC_PATH="/home/miniouser/go/bin/mc"
$MC_PATH - -quiet mirror $LOCAL_BACKUP_PATH $MINIO_BUCKET