[TNM] Problems with logfile name and POSIX escape syntax

Sari Thiele sari.thiele at usit.uio.no
Wed Apr 30 09:11:37 UTC 2014


Hi,

thanks for the answer, but unfortunately that does not solve my problem.
The problem is more that the program sets the date and time to the 
current date and time when the program starts and goes then back in 
30minutes steps.
The probability that it sets the right time to find the file is very low 
with this method.

In the example output below the real log file name is

postgresql-2014-04-29_125608.csv

, but he program is trying to find the files

/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_131629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_124629.csv


Here is some more information:
----------
/usr/bin/perl /usr/bin/tail_n_mail 
/home/postgres/etc/tailnmail/tnm.config.weekly.conf
WARNING! Skipping non-existent file 
"/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_131300.csv"
Too many loops (20161): bailing

----------

cat /home/postgres/etc/tailnmail/tnm.config.weekly.conf
## Config file for the tail_n_mail program
## This file is automatically updated
## Last updated: Tue Apr 29 13:13:00 2014
EMAIL: postgres-logs at usit.uio.no
MAILSUBJECT: [REPORT: HOST] - Log Report UNIQUE : NUMBER

INCLUDE: ERROR
INCLUDE: WARNING
INCLUDE: LOG


FILE1: /dbfiles/dbpg-test01/pg_adm/log/postgresql-%Y-%m-%d_%H%M%S.csv
LASTFILE1: /dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_131300.csv

----------

ll pg_adm/log/
total 36
-rw-------. 1 postgres postgres 4154 Apr 11 07:56 
postgresql-2014-04-04_134141.csv
-rw-------. 1 postgres postgres 1448 Apr 30 09:25 
postgresql-2014-04-29_125608.csv
-rw-------. 1 postgres postgres    0 Apr 29 12:56 
postgresql-2014-04-29_125608.log

----------

/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_101629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_094629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_091629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_084629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_081629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_074629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_071629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_064629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_061629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_054629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_051629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_044629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_041629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_034629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_031629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_024629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_021629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_014629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_011629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_004629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-30_001629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_234629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_231629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_224629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_221629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_214629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_211629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_204629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_201629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_194629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_191629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_184629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_181629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_174629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_171629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_164629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_161629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_154629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_151629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_144629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_141629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_134629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_131629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_124629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_121629.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2014-04-29_114629.csv
[..]
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2013-03-06_101630.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2013-03-06_094630.csv
/dbfiles/dbpg-test01/pg_adm/log/postgresql-2013-03-06_091630.csv


Is there another thing I can try to fix my problem?



On 04/28/2014 06:18 PM, Greg Sabino Mullane wrote:
> On Tue, Apr 22, 2014 at 07:35:53AM +0200, Sari Thiele wrote:
>>> WARNING! Skipping non-existent file "log/postgresql-2014-04-10_093905.csv"
>>> Too many loops (10081): bailing
>
> I'm wondering if simply going back further will allow it to work. Try using
> the latest git version, or just change the script like so:
>
> --- a/tail_n_mail
> +++ b/tail_n_mail
> @@ -494,7 +494,7 @@ sub pick_log_file {
>               ## We're going to walk backwards, 30 minutes at a time, and gather up
>               ## all files between "now" and the "last"
>               my $timerewind = 60*30; ## 30 minutes
> -            my $maxloops = 24*2 * 7 * 30; ## max of 30 days
> +            my $maxloops = 24*2 * 7 * 60; ## max of 60 days
>
>
>




More information about the TNM mailing list