Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/theycallmeswift/node-mongodb-s3-backup
A node.js package that makes syncing a MongoDB database to S3 simple.
https://github.com/theycallmeswift/node-mongodb-s3-backup
Last synced: 3 days ago
JSON representation
A node.js package that makes syncing a MongoDB database to S3 simple.
- Host: GitHub
- URL: https://github.com/theycallmeswift/node-mongodb-s3-backup
- Owner: theycallmeswift
- Created: 2012-10-29T20:40:12.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2015-10-02T18:44:41.000Z (about 9 years ago)
- Last Synced: 2024-11-02T11:34:56.869Z (10 days ago)
- Language: JavaScript
- Size: 229 KB
- Stars: 113
- Watchers: 10
- Forks: 47
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node MongoDB / S3 Backup
This is a package that makes backing up your mongo databases to S3 simple.
The binary file is a node cronjob that runs at midnight every day and backs up
the database specified in the config file.## Installation
npm install mongodb_s3_backup -g
## Configuration
To configure the backup, you need to pass the binary a JSON configuration file.
There is a sample configuration file supplied in the package (`config.sample.json`).
The file should have the following format:{
"mongodb": {
"host": "localhost",
"port": 27017,
"username": false,
"password": false,
"db": "database_to_backup"
},
"s3": {
"key": "your_s3_key",
"secret": "your_s3_secret",
"bucket": "s3_bucket_to_upload_to",
"destination": "/",
"encrypt": true,
"region": "s3_region_to_use"
},
"cron": {
"time": "11:59",
}
}All options in the "s3" object, except for desination, will be directly passed to knox, therefore, you can include any of the options listed [in the knox documentation](https://github.com/LearnBoost/knox#client-creation-options "Knox README").
### Crontabs
You may optionally substitute the cron "time" field with an explicit "crontab"
of the standard format `0 0 * * *`."cron": {
"crontab": "0 0 * * *"
}*Note*: The version of cron that we run supports a sixth digit (which is in seconds) if
you need it.### Timezones
The optional "timezone" allows you to specify timezone-relative time regardless
of local timezone on the host machine."cron": {
"time": "00:00",
"timezone": "America/New_York"
}You must first `npm install time` to use "timezone" specification.
## Running
To start a long-running process with scheduled cron job:
mongodb_s3_backup
To execute a backup immediately and exit:
mongodb_s3_backup -n