Backup compressed MySQL to B2 Cloud Storage
953
Backup compressed MySQL database to B2 Cloud Storage (supports periodic backups & mutli files)
$ docker run -e B2_ID=key-id -e B2_APP_KEY=app-key -e B2_BUCKET=my-bucket -e B2_PREFIX=backup -e B2_FILENAME=appdb -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_HOST=localhost danstreeter/mysql-backup-b2
MYSQLDUMP_OPTIONS mysqldump options (default: --quote-names --quick --add-drop-table --add-locks --allow-keywords --disable-keys --extended-insert --single-transaction --create-options --comments --net_buffer_length=16384)MYSQLDUMP_DATABASE list of databases you want to backup (default: --all-databases)MYSQL_HOST the mysql host requiredMYSQL_PORT the mysql port (default: 3306)MYSQL_USER the mysql user requiredMYSQL_PASSWORD the mysql password requiredB2_ID your B2 Cloud Key ID access key requiredB2_APP_KEY your B2 Cloud Application key requiredB2_BUCKET your B2 Cloud bucket name requiredB2_PREFIX path prefix in your bucket (default: 'backup')B2_FILENAME a consistent filename to overwrite with your backup. If not set will use a timestamp.MULTI_FILES Allow to have one file per database if set yes default: no)SCHEDULE backup schedule time, see explainatons belowYou can additionally set the SCHEDULE environment variable like -e SCHEDULE="@daily" to run the backup automatically.
More information about the scheduling can be found here.
The API keys used require the write privileges to your target bucket. A unauthorized error will be returned at the get_upload_url stage if your key does not have this privilege. See https://www.backblaze.com/b2/docs/b2_get_upload_url.html for more information.
Content type
Image
Digest
Size
14.1 MB
Last updated
over 7 years ago
docker pull danstreeter/mysql-backup-b2