From 34a4a113854550e258b8fd8be914505507a9c3c7 Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Mon, 15 Jun 2020 17:10:43 +0200 Subject: append to last log instead of overwriting it --- src/hourly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hourly.py b/src/hourly.py index 1fd223d..4c44141 100755 --- a/src/hourly.py +++ b/src/hourly.py @@ -39,7 +39,7 @@ def get_vpn_connections(cursor, hour): ''') return cursor.fetchall() -with open("/var/log/0tdns.log", "w") as logfile: +with open("/var/log/0tdns.log", "a") as logfile: # round down to an hour - this datetime format is one # of the formats accepted by postgres hour = strftime('%Y-%m-%d %H:00', gmtime()) -- cgit v1.2.3