Remixed from schickling/mysql-backup-s3
Backup MySQL to S3 (supports periodic backups & mutli files)
$ 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
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 requiredS3_ACCESS_KEY_ID your AWS access keyS3_SECRET_ACCESS_KEY your AWS secret keyS3_BUCKET your AWS S3 bucket pathS3_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 (default: none)S3_S3V4 set to yes to enable AWS Signature Version 4, required for minio servers (default: no)SCP_PORT defaults to 22, but can be setSCP_USER the ssh user to upload files toSCP_HOST the ssh host to upload files toSCP_PASS_FILE the passwordfile to use (preferably in a mounted secret)YEAR_FOLDER add a year in YYYY format to the folder structure (default: disabled)MONTH_FOLDER add a month in MM format to the folder structure (default: disabled)DAY_FOLDER add a day in DD format to the folder structure (default: disabled)FILE_LOCATION Specify the File path the backup is to be stored in (Only on default local storage or SCP type - S3_PREFIX performs the same function for S3 type)MULTI_FILES Allow to have one file per database if set yes (default: no)SCHEDULE backup schedule time, see explainatons belowTYPE S3, SCP or local backup (default: local)You can additionally set the SCHEDULE environment variable like -e SCHEDULE="@daily" to run the backup automatically.
If using cron configuration, it is set up as
Seconds | Minutes | Hours | Day of Month | Month | Day of Week
More information about the scheduling can be found here.
Content type
Image
Digest
sha256:ff8a68d65…
Size
53.1 MB
Last updated
about 1 year ago
docker pull atws/mysql-backup-localvol