mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-28 08:24:16 +03:00
parent
a66bd9b595
commit
71817137cd
5
db.js
5
db.js
@ -1590,10 +1590,13 @@ module.exports.CreateDB = function (parent, func) {
|
||||
var backupPath = parent.backuppath;
|
||||
if (parent.config.settings.autobackup && parent.config.settings.autobackup.backuppath) { backupPath = parent.config.settings.autobackup.backuppath; }
|
||||
try { parent.fs.mkdirSync(backupPath); } catch (e) { }
|
||||
const dburl = parent.args.mongodb;
|
||||
var mongoDumpPath = 'mongodump';
|
||||
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('?', '/?') + '\"'; }
|
||||
const child_process = require('child_process');
|
||||
child_process.exec('"' + mongoDumpPath + '"', { cwd: backupPath }, function (error, stdout, stderr) {
|
||||
child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
|
||||
try {
|
||||
if ((error != null) && (error != '')) {
|
||||
if (parent.platform == 'win32') {
|
||||
|
Loading…
Reference in New Issue
Block a user