Fixed server exception within performBackup()

This commit is contained in:
Ylian Saint-Hilaire 2020-02-28 10:37:50 -08:00
parent cb38a2dbfa
commit 6343705ac5

2
db.js
View File

@ -1236,7 +1236,7 @@ module.exports.CreateDB = function (parent, func) {
var mongoDumpPath = 'mongodump';
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\"';
var cmd = '\"' + mongoDumpPath + '\" --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 {