Merge pull request #2502 from nzalev/clean-checkBackupCapability-output

mongodump to dev null for dry-run effect
This commit is contained in:
Ylian Saint-Hilaire 2021-04-10 12:54:04 -07:00 committed by GitHub
commit cce07c297d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
db.js
View File

@ -1595,6 +1595,7 @@ module.exports.CreateDB = function (parent, func) {
if (parent.config.settings.autobackup && parent.config.settings.autobackup.mongodumppath) { mongoDumpPath = parent.config.settings.autobackup.mongodumppath; }
var cmd = '"' + mongoDumpPath + '"';
if (dburl) { cmd = '\"' + mongoDumpPath + '\" --uri=\"' + dburl.replace('?', '/?') + '\"'; }
cmd += (parent.platform == 'win32') ? ' --archive=\"nul\"' : ' --archive=\"/dev/null\"';
const child_process = require('child_process');
child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
try {