s3-mongo-backup
Advanced tools
Comparing version 1.4.1 to 1.4.2
@@ -6,3 +6,4 @@ const path = require('path'), | ||
AWS = require('aws-sdk'), | ||
os = require('os'); | ||
os = require('os'), | ||
PROJECT_ROOT = process.mainModule.paths[0].split("node_modules")[0]; | ||
@@ -18,3 +19,3 @@ let BACKUP_PATH = (ZIP_NAME) => path.resolve(os.tmpdir(), ZIP_NAME); | ||
if (config.keepLocalBackups) { | ||
fs.mkdir(path.resolve(__dirname, config.mongodb.name), err => { | ||
fs.mkdir(path.resolve(PROJECT_ROOT, config.mongodb.name), err => { | ||
if (err) { | ||
@@ -24,3 +25,3 @@ // Do nothing | ||
}); | ||
BACKUP_PATH = (ZIP_NAME) => path.resolve(__dirname, config.mongodb.name, ZIP_NAME); | ||
BACKUP_PATH = (ZIP_NAME) => path.resolve(PROJECT_ROOT, config.mongodb.name, ZIP_NAME); | ||
} | ||
@@ -27,0 +28,0 @@ return true; |
@@ -22,3 +22,3 @@ // Usually, It'll be | ||
}, | ||
keepLocalBackups: false, //If true, It'll create a folder with database's name and store backups in it and if it's false, It'll use temporary directory of OS. | ||
keepLocalBackups: false, //If true, It'll create a folder in project root with database's name and store backups in it and if it's false, It'll use temporary directory of OS. | ||
noOfLocalBackups: 2, //This will only keep the most recent 5 backups and delete all older backups from local backup directory | ||
@@ -42,2 +42,2 @@ timezoneOffset: 300 //Timezone, Used in naming backups, It is assumed to be in hours if less than 16 and in minutes otherwise | ||
}); | ||
}, 60 * 60 * 3 * 1000); //Every 3 hours | ||
}, 60 * 60 * 3 * 1000); //Every 3 hours |
{ | ||
"name": "s3-mongo-backup", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Backup and Upload MongoDB Databases to S3", | ||
@@ -5,0 +5,0 @@ "main": "backup.js", |
@@ -33,3 +33,3 @@ # s3-mongo-backup | ||
}, | ||
keepLocalBackups: false, //If true, It'll create a folder with database's name and store backups in it and if it's false, It'll use temporary directory of OS | ||
keepLocalBackups: false, //If true, It'll create a folder in project root with database's name and store backups in it and if it's false, It'll use temporary directory of OS | ||
noOfLocalBackups: 5, //This will only keep the most recent 5 backups and delete all older backups from local backup directory | ||
@@ -36,0 +36,0 @@ timezoneOffset: 300 //Timezone, It is assumed to be in hours if less than 16 and in minutes otherwise |
45656