tail_n_mail icon indicating copy to clipboard operation
tail_n_mail copied to clipboard

tail_n_mail searches old logs, but only once per day?

Open dtseiler opened this issue 6 years ago • 0 comments

Using version 1.31.3

$ ./tail_n_mail --version
./tail_n_mail version 1.31.3

Configured to just use the latest log file:

FILE1: /var/lib/pgsql/9.6/data/pg_log/LATEST
LASTFILE1: /var/lib/pgsql/9.6/data/pg_log/postgresql-2018-02-26_000000.log
OFFSET1: 2551862

Scheduled to run every 5 minutes: */5 * * * * /var/lib/pgsql/dba/bin/tail_n_mail /var/lib/pgsql/dba/etc/tnm.conf

However, at 00:05 (12:05 AM) every day, I get one report that lists errors in log files from many days ago. For example, the past 4 days, I've gotten alerts from maintenance work that was done on Feb 22:

Total matches: 25
Matches from [A] /var/lib/pgsql/9.6/data/pg_log/postgresql-2018-02-22_000000.log: 20
Matches from [B] /var/lib/pgsql/9.6/data/pg_log/postgresql-2018-02-22_101921.log:  3
Matches from [C] /var/lib/pgsql/9.6/data/pg_log/postgresql-2018-02-22_102154.log:  2

I'm curious as to the following:

  • Why am I getting these after that event has long passed and it isn't in the LASTFILE1? Why is tail_n_mail even looking in those 2018-02-22 log files?
  • Why do I get these alerts only at 12:05 AM? tail_n_mail runs every 5 minutes throughout the day, and tnm.conf gets updated every time.

Regardless it seems like a bug. I don't have tail_n_mail scheduled to run from anywhere else.

dtseiler avatar Feb 26 '18 14:02 dtseiler