From 4d10276cc11b462023511f8901f4515aabd2d3b9 Mon Sep 17 00:00:00 2001 From: Krateng Date: Sat, 20 Jun 2020 18:15:02 +0200 Subject: [PATCH] Added some log output --- maloja/proccontrol/tasks/backup.py | 5 +++++ maloja/proccontrol/tasks/fixexisting.py | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/maloja/proccontrol/tasks/backup.py b/maloja/proccontrol/tasks/backup.py index fe5c443..d3aefce 100644 --- a/maloja/proccontrol/tasks/backup.py +++ b/maloja/proccontrol/tasks/backup.py @@ -5,6 +5,8 @@ import os from ...globalconf import datadir from pathlib import PurePath +from doreah.logging import log + user_files = { "minimal":[ @@ -26,6 +28,8 @@ def backup(folder,level="full"): for g in selected_files: real_files += glob.glob(datadir(g)) + log("Creating backup of " + str(len(real_files)) + " files...") + now = datetime.utcnow() timestr = now.strftime("%Y_%m_%d_%H_%M_%S") filename = "maloja_backup_" + timestr + ".tar.gz" @@ -36,3 +40,4 @@ def backup(folder,level="full"): p = PurePath(f) r = p.relative_to(datadir()) archive.add(f,arcname=r) + log("Backup created!") diff --git a/maloja/proccontrol/tasks/fixexisting.py b/maloja/proccontrol/tasks/fixexisting.py index 35ca8af..76036c4 100644 --- a/maloja/proccontrol/tasks/fixexisting.py +++ b/maloja/proccontrol/tasks/fixexisting.py @@ -35,9 +35,10 @@ def fix(): #with open(datadir("logs","dbfix",nowstr + ".log"),"a") as logfile: - + log("Fixing database...") for filename in os.listdir(datadir("scrobbles")): if filename.endswith(".tsv"): + log("Fix file " + filename) filename_new = filename + "_new" with open(datadir("scrobbles",filename_new),"w") as newfile: @@ -68,3 +69,5 @@ def fix(): with open(datadir("scrobbles",filename + ".rulestate"),"w") as checkfile: checkfile.write(wendigo.checksums) + + log("Database fixed!")