]> OzVa Git service - form/commitdiff
Form download and reset backup
authorMax Value <greenwoodw50@gmail.com>
Mon, 21 Jul 2025 14:28:39 +0000 (15:28 +0100)
committerMax Value <greenwoodw50@gmail.com>
Mon, 21 Jul 2025 14:28:39 +0000 (15:28 +0100)
form.py

diff --git a/form.py b/form.py
index 07ed4e106957073cee24dee61466be888c7e192c..4a512f2b9d70d041ae2f77104c24777c70a008e2 100755 (executable)
--- a/form.py
+++ b/form.py
@@ -315,6 +315,7 @@ def get_data():
 
                        zfile.write(f"{app.root_path}/export/{table}.csv", f"{table}.csv")
 
+       zfile.write(f"{app.root_path}/form.log", "form.log")
        zfile.close()
 
        return send_from_directory(app.root_path, "export.zip", as_attachment=True)
@@ -345,6 +346,9 @@ def http_backup():
 @auth.login_required
 def reset():
        backup_time = round(time.time())
+
+       os.rename(f"{app.root_path}/form.log", f"{app.root_path}/backup/form{backup_time}.log")
+
        with sqlite3.connect(f"{app.root_path}/database.db") as src:
                dst = sqlite3.connect(f"{app.root_path}/backup/reset{backup_time}.db")
                src.backup(dst)