Skip to content

A node.js program to backup MySQL dbs and upload to S3

Notifications You must be signed in to change notification settings

stvmlbrn/mysql-backup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MySQL Backup

A Node.js script to backup MySQL databases to Amazon S3. Note - this script spawns mysqldump so it needs to exist in the path local to where you are running this program.

Getting Started

  • Clone this repo: git clone https://github.com/stvmlbrn/mysql-backup.git && cd mysql-backup
  • Run npm install
  • The script uses dotenv to access environment variables. You'll need to manually created the .env file and add the required variables.

Required environment variables

  • DB_HOST = Host name or IP address of the database server
  • DB_USER = Username used to connect to the server
  • DB_PASS = Password used to connect to the server
  • S3_ACCESS_KEY = Your AWS access key
  • S3_SECRET_KEY = Your AWS secret key
  • S3_BUCKET = Name of the bucket you are uploading to
  • BACKUP_PATH = Path to the directory where the files will be backed up before uploading to S3.

Optional environment variables

  • CRONALARM_KEY = The API key for CronAlarm. If you do not want to integrate with CronAlarm you can run the script with the -nomonitor parameter.

About

A node.js program to backup MySQL dbs and upload to S3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published