Skip to content

Commit e06c570

Browse files
committed
config value to disable backups, closes zadam#1533
1 parent fe3bb2c commit e06c570

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

config-sample.ini

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ instanceName=
55
# set to true to allow using Trilium without authentication (makes sense for server build only, desktop build doesn't need password)
66
noAuthentication=false
77

8+
# set to true to disable backups (e.g. because of limited space on server)
9+
noBackup=false
10+
811
# Disable automatically generating desktop icon
912
# noDesktopIcon=true
1013

src/services/sql_init.js

+7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const Option = require('../entities/option');
99
const TaskContext = require('./task_context.js');
1010
const migrationService = require('./migration');
1111
const cls = require('./cls');
12+
const config = require('./config');
1213

1314
const dbReady = utils.deferred();
1415

@@ -131,6 +132,12 @@ function setDbAsInitialized() {
131132
}
132133

133134
dbReady.then(() => {
135+
if (config.General && config.General.noBackup === true) {
136+
log.info("Disabling scheduled backups.");
137+
138+
return;
139+
}
140+
134141
setInterval(() => require('./backup').regularBackup(), 4 * 60 * 60 * 1000);
135142

136143
// kickoff first backup soon after start up

0 commit comments

Comments
 (0)