Added dbname to mysql/mariadb autobackup

Noah Zalev committed Apr 23, 2021 at 12:23 UTC e1636626102fdd3f799abe67a8575d0bc7b6b0f1
1 file changed +2 -1
db.js
+2 -1
@@ -1807,7 +1807,8 @@ module.exports.CreateDB = function (parent, func) {
1807 cmd += (parent.platform == 'win32') ? ' --password=\"' + props.password + '\"' : ' --password=\'' + props.password + '\'';
1808 if (props.host) { cmd += ' -h ' + props.host; }
1809 if (props.port) { cmd += ' -P ' + props.port; }
1810 - cmd += ' meshcentral --result-file=\"' + newBackupPath + '.sql\"';
1810 + var sqldbname = (props.database) ? props.database : 'meshcentral';
1811 + cmd += ' ' + sqldbname + ' --result-file=\"' + newBackupPath + '.sql\"';
1812 const child_process = require('child_process');
1813 var backupProcess = child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
1814 try {