On Tue, 6 Apr 2010, Jan Stary wrote:

No it's not. Unless you have some heavy traffic just around the midnight
that is the border between months, the above newsyslog line makes
the just-rotated access_log.0.gz contains the log of the month-that-just-ended.

OK. How do I reliably get month and year out of the file?
Month I can get from the newsyslog output it puts in the logs,
getting year without doing some sort of nasty kludge is hard.

m=$(zfgrep "logfile turned over" "$file" | tail -n 1 | cut -b 1-3)

I'm using www/visitors to produce something meaningful from those
logs, and I would like to generate stats just once for a certain
time period so I can later see stats further than one year that newsyslog
keeps.

webalizer

I told I'm using visitors.

--
Antti Harri

Reply via email to