Skip to content

Commit

Permalink
hour function
Browse files Browse the repository at this point in the history
  • Loading branch information
FxKu committed Sep 12, 2024
1 parent 0ec8dc9 commit 179c6c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion postgres-appliance/bootstrap/maybe_pg_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


Expand Down

0 comments on commit 179c6c7

Please sign in to comment.