Last active
January 5, 2016 21:12
-
-
Save bradoyler/f1a013de4747b5d7c369 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoBackup = require('mongo-backup-to-s3'); | |
var CronJob = require('cron').CronJob; | |
var backupConfig = { mongodb:{ url: process.env.MONGO_URL }, s3:{ bucket:'mybucket', folder:'backups', key: process.env.AWS_ACCESS_KEY, secret: process.env.AWS_SECRET_KEY }}; | |
new CronJob('01 45 03 * * *', function(){ // everyday @ 3:45am EDT | |
mongoBackup.dumpToS3(backupConfig); | |
}, null, true, 'America/New_York'); // sets timezone |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment