backups: restore local backups in-app

This commit is contained in:
Harvey Tindall
2023-12-21 17:42:07 +00:00
parent ff73c72b0e
commit eff313be41
4 changed files with 33 additions and 2 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ func (app *appContext) loadPendingBackup() {
if LOADBAK == "" {
return
}
oldPath := filepath.Join(app.dataPath, "db-pre-"+filepath.Base(LOADBAK))
oldPath := filepath.Join(app.dataPath, "db-"+string(time.Now().Unix())+"-pre-"+filepath.Base(LOADBAK))
app.info.Printf("Moving existing database to \"%s\"\n", oldPath)
err := os.Rename(app.storage.db_path, oldPath)
if err != nil {