mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
Make autobackup: false disable all backup functions and remove cmdline from checkbackup error message. (#7225)
This commit is contained in:
8
db.js
8
db.js
@@ -3348,7 +3348,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||
// Tries configured custom location with fallback to default location
|
||||
// Now runs after autobackup config init in meshcentral.js so config options are checked
|
||||
obj.checkBackupCapability = function (func) {
|
||||
if ((parent.config.settings.autobackup == null) || (parent.config.settings.autobackup == false)) { return; };
|
||||
if (parent.config.settings.autobackup.backupintervalhours == -1) { return; };
|
||||
//block backup until validated. Gets put back if all checks are ok.
|
||||
let backupInterval = parent.config.settings.autobackup.backupintervalhours;
|
||||
parent.config.settings.autobackup.backupintervalhours = -1;
|
||||
@@ -3395,7 +3395,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||
const child_process = require('child_process');
|
||||
child_process.exec(cmd, { cwd: backupPath }, function (error, stdout, stderr) {
|
||||
if ((error != null) && (error != '')) {
|
||||
func(1, "Mongodump error, backup will not be performed. Command tried: " + cmd + ' --> ERROR: ' + stderr);
|
||||
func(1, "Mongodump error, backup will not be performed. Check path or use mongodumppath & mongodumpargs");
|
||||
return;
|
||||
} else {parent.config.settings.autobackup.backupintervalhours = backupInterval;}
|
||||
});
|
||||
@@ -3406,7 +3406,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||
const child_process = require('child_process');
|
||||
child_process.exec(cmd, { cwd: backupPath, timeout: 1000*30 }, function(error, stdout, stdin) {
|
||||
if ((error != null) && (error != '')) {
|
||||
func(1, "mysqldump error, backup will not be performed. Command tried: " + cmd);
|
||||
func(1, "mysqldump error, backup will not be performed. Check path or use mysqldumppath");
|
||||
return;
|
||||
} else {parent.config.settings.autobackup.backupintervalhours = backupInterval;}
|
||||
|
||||
@@ -3421,7 +3421,7 @@ module.exports.CreateDB = function (parent, func) {
|
||||
const child_process = require('child_process');
|
||||
child_process.exec(cmd, { cwd: backupPath }, function(error, stdout, stdin) {
|
||||
if ((error != null) && (error != '')) {
|
||||
func(1, "pg_dump error, backup will not be performed. Command tried: " + cmd);
|
||||
func(1, "pg_dump error, backup will not be performed. Check path or use pgdumppath.");
|
||||
return;
|
||||
} else {parent.config.settings.autobackup.backupintervalhours = backupInterval;}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user