Sign inSign up

atws/mysql-backup-localvol

By atws

•Updated about 1 year ago

Image
0

1.5K

atws/mysql-backup-localvol repository overview

Remixed from schickling/mysql-backup-s3

⁠mysql-backup-s3

Backup MySQL to S3 (supports periodic backups & mutli files)

⁠Basic usage

$ 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

⁠MySQL Options
  • 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
⁠TYPE = S3 Options
  • S3_ACCESS_KEY_ID your AWS access key
  • S3_SECRET_ACCESS_KEY your AWS secret key
  • S3_BUCKET your AWS S3 bucket path
  • 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⁠ (default: none)
  • S3_S3V4 set to yes to enable AWS Signature Version 4, required for minio⁠ servers (default: no)
⁠TYPE = SCP Options
  • SCP_PORT defaults to 22, but can be set
  • SCP_USER the ssh user to upload files to
  • SCP_HOST the ssh host to upload files to
  • SCP_PASS_FILE the passwordfile to use (preferably in a mounted secret)
  • `SCP_PASS the password to use for ssh (preferably from a secret)
⁠Folder Options
  • 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)
  • Folder flags will appear in the order listed (ie. YYYY/MM/DD) after the FILE_LOCATION variable
⁠General Options
  • 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 below
  • TYPE S3, SCP or local backup (default: local)
⁠Automatic Periodic Backups

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⁠.

Tag summary

Content type

Image

Digest

sha256:ff8a68d65…

Size

53.1 MB

Last updated

about 1 year ago

docker pull atws/mysql-backup-localvol