Merge pull request #888 from whalehub/patch-1

Fix mongodump command syntax
This commit is contained in:
Ylian Saint-Hilaire 2020-01-29 14:34:31 -08:00 committed by GitHub
commit c404787f2c

4
db.js
View File

@ -987,7 +987,7 @@ module.exports.CreateDB = function (parent, func) {
if (parent.config.settings.autobackup && parent.config.settings.autobackup.mongodumppath) { mongoDumpPath = parent.config.settings.autobackup.mongodumppath; }
const child_process = require('child_process');
const cmd = '\"' + mongoDumpPath + '\" --db=\"' + dbname + '\" --archive=\"' + newBackupPath + '.archive\"';
if (dburl) { cmd = '\"' + mongoDumpPath + '\" --url=\"' + dburl + '\" --db=\"' + dbname + '\" --archive=\"' + newBackupPath + '.archive\"'; }
if (dburl) { cmd = '\"' + mongoDumpPath + '\" --uri=\"' + dburl + '\" --archive=\"' + newBackupPath + '.archive\"'; }
var backupProcess = child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
try {
backupProcess = null;
@ -1125,4 +1125,4 @@ module.exports.CreateDB = function (parent, func) {
}
return obj;
};
};