Skip to content

tail_n_mail searches old logs, but only once per day? #27

@dtseiler

Description

@dtseiler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions