config value to disable backups, closes #1533

This commit is contained in:
zadam 2021-01-12 21:50:05 +01:00
parent fe3bb2c5f6
commit e06c5703ee
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,9 @@ instanceName=
# set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password)
noAuthentication=false
# set to true to disable backups (e.g. because of limited space on server)
noBackup=false
# Disable automatically generating desktop icon
# noDesktopIcon=true

View File

@ -9,6 +9,7 @@ const Option = require('../entities/option');
const TaskContext = require('./task_context.js');
const migrationService = require('./migration');
const cls = require('./cls');
const config = require('./config');
const dbReady = utils.deferred();
@ -131,6 +132,12 @@ function setDbAsInitialized() {
}
dbReady.then(() => {
if (config.General && config.General.noBackup === true) {
log.info("Disabling scheduled backups.");
return;
}
setInterval(() => require('./backup').regularBackup(), 4 * 60 * 60 * 1000);
// kickoff first backup soon after start up