diff options
author | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-17 14:24:24 +0200 |
---|---|---|
committer | Wojciech Kosior <kwojtus@protonmail.com> | 2020-06-17 14:24:24 +0200 |
commit | 1017dfb223bc857a2327dbad90b8c68e8664d3fe (patch) | |
tree | a852725839bf5dc72965e3d3c98da6b4ebf656ee /src/hourly.py | |
parent | 7caef553b4061b6179c2757cb3bbd4e17e892cf7 (diff) | |
download | 0tdns-1017dfb223bc857a2327dbad90b8c68e8664d3fe.tar.gz 0tdns-1017dfb223bc857a2327dbad90b8c68e8664d3fe.zip |
prepend log message with an hour
Diffstat (limited to 'src/hourly.py')
-rwxr-xr-x | src/hourly.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/hourly.py b/src/hourly.py index 4fd30a6..ecf1f10 100755 --- a/src/hourly.py +++ b/src/hourly.py @@ -10,7 +10,7 @@ import psycopg2 # our own module used by several scripts in the project from ztdnslib import start_db_connection, \ - get_default_host_address, get_ztdns_config, log + get_default_host_address, get_ztdns_config, log, set_loghour wrapper = '/var/lib/0tdns/vpn_wrapper.sh' perform_queries = '/var/lib/0tdns/perform_queries.py' @@ -251,6 +251,8 @@ def do_hourly_work(hour): # round down to an hour - this datetime format is one # of the formats accepted by postgres hour = strftime('%Y-%m-%d %H:00%z', gmtime()) +set_loghour(hour) # log() function will now prepend messages with hour + if not lock_on_file(): log('Failed trying to run for {}; {} exists'.format(hour, lockfile)) else: |