mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-10-26 11:27:04 +00:00
fix(backup): honor settings.autobackup.backuppath everywhere; make obj.backuppath single source of truth
Deleting old backups failed when using a non-default folder because `settings.autobackup.backuppath` from `config.json` was not respected consistently. - Set `obj.backuppath` from `config.json` at startup (when configured) Follow-up: The lookups of parent.config.settings.autobackup in `db.js` are now redundant and should be removed the next time `db.js` is touched.
This commit is contained in:
parent
dedae6c495
commit
cedf1bf29e
@ -116,9 +116,12 @@ function CreateMeshCentralServer(config, args) {
|
||||
});
|
||||
|
||||
// Look to see if data and/or file path is specified
|
||||
if (obj.config.settings && (typeof obj.config.settings.datapath == 'string')) { obj.datapath = obj.config.settings.datapath; }
|
||||
if (obj.config.settings && (typeof obj.config.settings.filespath == 'string')) { obj.filespath = obj.config.settings.filespath; }
|
||||
|
||||
if (obj.config.settings) {
|
||||
if (typeof obj.config.settings.datapath == 'string') { obj.datapath = obj.config.settings.datapath; }
|
||||
if (typeof obj.config.settings.filespath == 'string') { obj.filespath = obj.config.settings.filespath; }
|
||||
if (typeof obj.config.settings.autobackup.backuppath == 'string') { obj.backuppath = obj.config.settings.autobackup.backuppath; }
|
||||
}
|
||||
|
||||
// Create data and files folders if needed
|
||||
try { obj.fs.mkdirSync(obj.datapath); } catch (ex) { }
|
||||
try { obj.fs.mkdirSync(obj.filespath); } catch (ex) { }
|
||||
|
||||
Loading…
Reference in New Issue
Block a user