From 179c6c7fa9a20d75ba0b72bcbc423e5b693ef297 Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Thu, 12 Sep 2024 15:02:44 +0200 Subject: [PATCH] hour function --- postgres-appliance/bootstrap/maybe_pg_upgrade.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres-appliance/bootstrap/maybe_pg_upgrade.py b/postgres-appliance/bootstrap/maybe_pg_upgrade.py index 86086e8e..2acd01a9 100644 --- a/postgres-appliance/bootstrap/maybe_pg_upgrade.py +++ b/postgres-appliance/bootstrap/maybe_pg_upgrade.py @@ -12,7 +12,7 @@ def tail_postgres_log(weekday): logdir = os.environ.get('PGLOG', '/home/postgres/pgdata/pgroot/pg_log') logfile = os.path.join(logdir, 'postgresql-{0}.csv'.format(weekday)) if os.getenv('LOG_SHIP_HOURLY') == 'true': - logfile = os.path.join(logdir, 'postgresql-{0}-{1}.csv'.format(weekday, datetime.datetime.today().hour)) + logfile = os.path.join(logdir, 'postgresql-{0}-{1}.csv'.format(weekday, datetime.datetime.today().hour())) return subprocess.check_output(['tail', '-n5', logfile]).decode('utf-8')