feat(backup): add backup dir path configure

This commit is contained in:
OldHawk
2017-10-31 09:12:41 +08:00
parent f9d0f68ee5
commit 5f455dd696
2 changed files with 4 additions and 2 deletions

View File

@@ -29,7 +29,9 @@ module.exports = {
* at midnight every day.
*/
backup: {
enable: true
enable: true,
dir: './modules/core/client/backup/'
},
/**

View File

@@ -94,7 +94,7 @@ function cronJobBackupMongoDB() {
backup({
uri: config.db.uri, // mongodb://<dbuser>:<dbpassword>@<dbdomain>.mongolab.com:<dbport>/<dbdatabase>
options: config.db.options || {},
root: './modules/core/client/backup/',
root: backupConfig.dir,
parser: 'json',
tar: appConfig.name + '-backup-' + moment().format('YYYYMMDD-HHmmss') + '.tar'
});