diff --git a/script.py b/script.py index bd65a48..f5c02ae 100644 --- a/script.py +++ b/script.py @@ -4,9 +4,13 @@ from datetime import datetime, timedelta import os import fnmatch +#create the log directory +path = "./logs" +if not os.path.exists(path): + os.makedirs(path) # TODO: check sorting of these files (should be chronological) # Getting the dynamic variables -log_files = fnmatch.filter(os.listdir("./logs"), '*.html') +log_files = fnmatch.filter(os.listdir(path), '*.html') now = datetime.today() next_report = now + timedelta(hours=3) log_file_name = "log_" + now.strftime("%Y-%m-%d_%H:%M:%S") + ".html"