https://github.com/daemonite/mysql-backup-s3
Forked from https://github.com/schickling/dockerfiles/tree/master/mysql-backup-s3
https://github.com/daemonite/mysql-backup-s3
Last synced: 5 months ago
JSON representation
Forked from https://github.com/schickling/dockerfiles/tree/master/mysql-backup-s3
- Host: GitHub
- URL: https://github.com/daemonite/mysql-backup-s3
- Owner: Daemonite
- License: mit
- Created: 2019-11-07T06:09:21.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-11-08T05:28:54.000Z (over 5 years ago)
- Last Synced: 2024-03-26T15:02:31.538Z (about 1 year ago)
- Language: Shell
- Size: 8.79 KB
- Stars: 1
- Watchers: 4
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> Forked from https://github.com/schickling/dockerfiles/tree/master/mysql-backup-s3
# mysql-backup-s3
Backup MySQL to S3 (supports periodic backups & mutli files).
- Updated to use an Ubuntu base image with the latest MySQL Client tools
- Removed support for `SCHEDULE` using go-cron
- Replaced `MULTI_FILES` with `MULTI_DATABASES`, always one file per DB
- Removed `--databases` argument so SQL won't include `CREATE DATABASE` / `USE` statements
- Updated default `MYSQLDUMP_OPTIONS` environment variable## Basic usage
```sh
$ docker run -e S3_ACCESS_KEY_ID=key -e S3_SECRET_ACCESS_KEY=secret -e S3_BUCKET=my-bucket -e S3_PREFIX=backup -e MYSQL_USER=user -e MYSQL_PASSWORD=password -e MYSQL_HOST=localhost schickling/mysql-backup-s3
```## Environment variables
- `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 *required*
- `MYSQL_PORT` the mysql port (default: 3306)
- `MYSQL_USER` the mysql user *required*
- `MYSQL_PASSWORD` the mysql password *required*
- `S3_ACCESS_KEY_ID` your AWS access key *required*
- `S3_SECRET_ACCESS_KEY` your AWS secret key *required*
- `S3_BUCKET` your AWS S3 bucket path *required*
- `S3_PREFIX` path prefix in your bucket (default: 'backup')
- `S3_FILENAME` a consistent filename to overwrite with your backup. If not set will use a timestamp.
- `S3_REGION` the AWS S3 bucket region (default: us-west-1)
- `S3_ENDPOINT` the AWS Endpoint URL, for S3 Compliant APIs such as [minio](https://minio.io) (default: none)
- `S3_S3V4` set to `yes` to enable AWS Signature Version 4, required for [minio](https://minio.io) servers (default: no)
- `MULTI_DATABASES` Allow to have one file per database if set `yes` default: no)