fix autobackup: true
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
parent
aaad8b79cc
commit
62cae4cf8a
|
@ -818,8 +818,11 @@
|
|||
]
|
||||
},
|
||||
"autoBackup": {
|
||||
"type": "object",
|
||||
"description": "Enable automatic backups of your meshcentral-data",
|
||||
"type": [
|
||||
"boolean",
|
||||
"object"
|
||||
],
|
||||
"description": "If set to \"true\", automatic backups of your MeshCentral data will be enabled. Alternatively, you can provide an object with additional values such as \"webdav\", \"backupPath\", \"backupIntervalHours\", and more.",
|
||||
"properties": {
|
||||
"mongoDumpPath": {
|
||||
"type": "string",
|
||||
|
|
|
@ -1957,9 +1957,9 @@ function CreateMeshCentralServer(config, args) {
|
|||
obj.updateServerState('state', "running");
|
||||
|
||||
// Setup auto-backup defaults
|
||||
if (obj.config.settings.autobackup == null) { obj.config.settings.autobackup = { backupintervalhours: 24, keeplastdaysbackup: 10 }; }
|
||||
if (obj.config.settings.autobackup == null || obj.config.settings.autobackup === true) { obj.config.settings.autobackup = { backupintervalhours: 24, keeplastdaysbackup: 10 }; }
|
||||
else if (obj.config.settings.autobackup === false) { delete obj.config.settings.autobackup; }
|
||||
else {
|
||||
else if (typeof obj.config.settings.autobackup == 'object'){
|
||||
if (typeof obj.config.settings.autobackup.backupintervalhours != 'number') { obj.config.settings.autobackup.backupintervalhours = 24; }
|
||||
if (typeof obj.config.settings.autobackup.keeplastdaysbackup != 'number') { obj.config.settings.autobackup.keeplastdaysbackup = 10; }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue