fix backup

pull/255/head
zadam 2020-06-03 12:16:16 +07:00
parent 9de7d3fc53
commit c1fd9825aa
2 changed files with 9 additions and 10 deletions

@ -17,19 +17,18 @@ const TPL = `
<button id="find-and-fix-consistency-issues-button" class="btn">Find and fix consistency issues</button><br/><br/> <button id="find-and-fix-consistency-issues-button" class="btn">Find and fix consistency issues</button><br/><br/>
<h4>Debugging</h4> <h4>Anonymize database</h4>
<button id="anonymize-button" class="btn">Save anonymized database</button><br/><br/> <p>This action will create a new copy of the database and anonymise it (remove all note content and leave only structure and some non-sensitive metadata)
<p>This action will create a new copy of the database and anonymise it (remove all note content and leave only structure and metadata)
for sharing online for debugging purposes without fear of leaking your personal data.</p> for sharing online for debugging purposes without fear of leaking your personal data.</p>
<button id="anonymize-button" class="btn">Save anonymized database</button><br/><br/>
<h4>Backup database</h4> <h4>Backup database</h4>
<button id="backup-database-button" class="btn">Backup database</button> <p>Trilium has automatic backup (daily, weekly, monthly), but you can also trigger backup manually here.</p>
<br/> <button id="backup-database-button" class="btn">Backup database now</button><br/><br/>
<br/>
<h4>Vacuum database</h4> <h4>Vacuum database</h4>

@ -63,13 +63,13 @@ async function backupNow(name) {
return await syncMutexService.doExclusively(async () => { return await syncMutexService.doExclusively(async () => {
const backupFile = `${dataDir.BACKUP_DIR}/backup-${name}.db`; const backupFile = `${dataDir.BACKUP_DIR}/backup-${name}.db`;
const success = await copyFile(backupFile, sql); const success = await copyFile(backupFile);
if (success) { if (success) {
log.error(`Creating backup ${backupFile} failed`); log.info("Created backup at " + backupFile);
} }
else { else {
log.info("Created backup at " + backupFile); log.error(`Creating backup ${backupFile} failed`);
} }
return backupFile; return backupFile;