Added dbname to mysql/mariadb autobackup

This commit is contained in:
Noah Zalev 2021-04-23 12:23:58 -04:00
parent d6aaecc4a6
commit e163662610

3
db.js
View File

@ -1807,7 +1807,8 @@ module.exports.CreateDB = function (parent, func) {
cmd += (parent.platform == 'win32') ? ' --password=\"' + props.password + '\"' : ' --password=\'' + props.password + '\'';
if (props.host) { cmd += ' -h ' + props.host; }
if (props.port) { cmd += ' -P ' + props.port; }
cmd += ' meshcentral --result-file=\"' + newBackupPath + '.sql\"';
var sqldbname = (props.database) ? props.database : 'meshcentral';
cmd += ' ' + sqldbname + ' --result-file=\"' + newBackupPath + '.sql\"';
const child_process = require('child_process');
var backupProcess = child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
try {