1.0.2 • Published 7 years ago

iridium-mongodb-backup v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

MongoDB Backup with AWS S3

Installation
npm install mongodb-auto-backup
Configuration
var db_backup = require('iridium-mongodb-backup');

db_backup.config({
     db: '<Database Name>', // Required
     output: '<Output to local Directory>', // Required
     dir_prefix: '<Directory prefix>', // Optional
     deleteLocal: true | false,
     s3Upload: true | false, // Default: false, Optional
     accessKeyId: '<AWS accessKeyId>',
     secretAccessKey: '<AWS secretAccessKey>',
     bucket: '<AWS Bucket name>',
     region: '<AWS Bucket Region Name>',
     debug: true | false // Default: true, Optional
    
 });
Run Manually
db_backup.run();
Schedule
db_backup.schedule('<Schdule>');

We use node-cron to run cron jobs, This is a quick reference to cron syntax and also shows the options supported by node-cron.

Allowed fields
 # ┌────────────── second (optional)
 # │ ┌──────────── minute
 # │ │ ┌────────── hour
 # │ │ │ ┌──────── day of month
 # │ │ │ │ ┌────── month
 # │ │ │ │ │ ┌──── day of week
 # │ │ │ │ │ │
 # │ │ │ │ │ │
 # * * * * * *

Allowed values

fieldvalue
second0-59
minute0-59
hour0-23
day of month1-31
month1-12 (or names)
day of week0-7 (or names, 0 or 7 are sunday)