Sign inSign up

th0th/mysql-s3-backup

By th0th

•Updated almost 2 years ago

Image
0

639

th0th/mysql-s3-backup repository overview

mysql-s3-backup is a MySQL backup helper that:

  • Takes the dump of the MySQL database
  • Uploads it to AWS' object storage service S3
  • Reports to WebGazer⁠ (optional)

⁠Usage

⁠Environment variables
VariableRequiredDefault valueDescription
AWS_ACCESS_KEY_ID✔Access key id for the AWS account
AWS_REGION✔Region for the AWS bucket
AWS_S3_ENDPOINT✔AWS S3 endpoint with bucket and path (e.g. "my-bucket/mysql-backup")
AWS_S3_STORAGE_CLASSSTANDARD_IAAWS S3 storage class (see https://aws.amazon.com/s3/storage-classes/⁠ and https://rclone.org/s3/#s3-storage-class⁠ for options.
AWS_SECRET_ACCESS_KEY✔Secret access key for the AWS account
MYSQL_DB✔MySQL server database
MYSQL_HOSTmysqlMySQL server host
MYSQL_PASSWORD✔MySQL server password
MYSQL_PORT3306MySQL server port
MYSQL_USERrootMySQL server user
WEBGAZER_HEARTBEAT_URLWebGazer Heartbeat Monitor⁠ URL
⁠Running
$ docker run \
  -e AWS_ACCESS_KEY_ID=<aws_access_key_id> \
  -e AWS_REGION=<aws_region> \
  -e AWS_S3_ENDPOINT=<aws_s3_endpoint> \
  -e AWS_S3_STORAGE_CLASS=<aws_s3_storage_class[STANDARD_IA]> \
  -e AWS_SECRET_ACCESS_KEY=<aws_secret_access_key> \
  -e MYSQL_DB=<database> \
  -e MYSQL_HOST=<mysql_hostname[mysql]> \
  -e MYSQL_PASSWORD=<mysql_password> \
  -e MYSQL_PORT=<mysql_port[3306]> \
  -e MYSQL_USER=<mysql_user[root]> \
  -e WEBGAZER_HEARTBEAT_URL=<webgazer_heartbeat_url> \
  th0th/mysql-s3-backup
⁠Example
$ docker run \
  -e AWS_ACCESS_KEY_ID=g9XqNnqKmUk6xqwkStkN \
  -e AWS_REGION=eu-west-1 \
  -e AWS_S3_ENDPOINT=my-bucket/mysql-backup \
  -e AWS_S3_STORAGE_CLASS=GLACIER \
  -e AWS_SECRET_ACCESS_KEY=GLBZ8mQf27UL57YHbkLhXWtfJWVwtUBbQup6mFzw \
  -e MYSQL_DB=database \
  -e MYSQL_HOST=mysql \
  -e MYSQL_PASSWORD=mysql_password \
  -e MYSQL_PORT=3306 \
  -e MYSQL_USER=mysql_user \
  -e WEBGAZER_HEARTBEAT_URL=https://heartbeat.webgazer.io/1-8f713c75d659 \
  th0th/mysql-s3-backup

⁠Shameless plug

I am an indie hacker, and I am running two services that might be useful for your business. Check them out :)

⁠WebGazer

WebGazer

WebGazer⁠ is a monitoring service that checks your website, cron jobs, or scheduled tasks on a regular basis. It notifies you with instant alerts in case of a problem. That way, you have peace of mind about the status of your service without manually checking it.

⁠PoeticMetric

PoeticMetric

PoeticMetric⁠ is a privacy-first, regulation-compliant, blazingly fast analytics tool.

No cookies or personal data collection. So you don't have to worry about cookie banners or GDPR, CCPA, and PECR compliance.

⁠License

Copyright © 2022, Gokhan Sari. Released under the MIT License⁠.

Tag summary

Content type

Image

Digest

sha256:1bd00832c…

Size

47.3 MB

Last updated

almost 2 years ago

docker pull th0th/mysql-s3-backup