From a7ceabafc10d15aa1f2b61adcc15fe3a83ed4c96 Mon Sep 17 00:00:00 2001 From: Aaron <44198148+whalehub@users.noreply.github.com> Date: Wed, 29 Jan 2020 21:12:09 +0100 Subject: [PATCH] Fix mongodump command syntax --- db.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db.js b/db.js index 16ec6201..9f620a5c 100644 --- a/db.js +++ b/db.js @@ -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; -}; \ No newline at end of file +};