On Apr 06 16:39:51, Antti Harri wrote: > Hi all, > > I want to hijack this thread a little because it sounds like > OP has similar problem to mine. > > I'm rotating logs with newsyslog and for example for web logs > I keep 12 logs available (actually it looks like count=12 keeps 13 > files available but anyway that's not my problem..), rotated monthly so I > have logs from present moment to one year back like this: > > # ls access_log* | sort -n -k 2 -t . > access_log > access_log.0.gz > access_log.1.gz > access_log.2.gz > access_log.3.gz > access_log.4.gz > access_log.5.gz > access_log.6.gz > access_log.7.gz > access_log.8.gz > access_log.9.gz > access_log.10.gz > access_log.11.gz > access_log.12.gz > > The newsyslog.conf looks like this: > > /path/access_log vhost3:wheel 640 12 * $M1D0 Z > > My problem is that when I want to produce something based on those > files, it is very hard to know the time range of the actual contents.
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. > 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