Skip to content

Dump a MySQL database and sync the backup to AWS S3.

License

Notifications You must be signed in to change notification settings

ryanburnette/mysql-dump-s3-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

repo npm

Dump a MySQL database and sync the backup to AWS S3.

Usage

npm install @ryanburnette/mysql-dump-s3-sync

Always configure AWS using the environment.

All other options can be configured in the environment or as an opts object passed to backup().

# .env

# Configure DB explicitly... or
DB_HOST=
DB_PORT=
DB_NAME=
DB_USER=
DB_PASS=

# Configure DB by URL
DB_URL=

# AWS
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_BUCKET=

# Other options
LOGGING=

Run a backup.

npx backup

Make it a scheduled service.

// service.js
require('@ryanburnette/mysql-dump-s3-sync/cron')({
  schedule: '0 0 * * *'
});

First, install go-serviceman so we can add services in the easiest possible way.

sudo serviceman add --system --path $PATH node service.js

About

Dump a MySQL database and sync the backup to AWS S3.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published