[Wylug-help] logrotate

Roger roger at roger-beaumont.co.uk
Thu Mar 19 23:17:06 UTC 2009


Hi,

I want to analyse logs for a couple of Apache-driven websites using 'analog'

The default logrotate.conf file specifies weekly rotation, keeping 4 
generations - which is no good for seeing month on month developments.
Accordingly, I added:
---------------------------------------------
/etc/httpd/logs/site1-access_log /etc/httpd/logs/site2-access_log {
   rotate 17
}
---------------------------------------------

which I thought would preserve the logs for 17 weeks: 4 calendar months.

Unfortunately, this seems to be interacting with the instructions in 
/etc/logrotate.d/httpd
---------------------------------------------
/var/log/httpd/*log {
     missingok
     notifempty
     sharedscripts
     postrotate
         /sbin/service httpd reload > /dev/null 2>/dev/null || true
     endscript
}

---------------------------------------------
Now what I'm getting is 6 generations of the log, but each alternate one 
is empty, making only 3 useful files.

To get round that, I've just changed the default conf to:
---------------------------------------------
# rotate log files weekly
weekly
# normally keep 4 weeks worth of backlogs
# rotate 4
rotate 17
---------------------------------------------

Of course, that will presumably affect all logs, not just the couple of 
httpd logs I want to persist longer.

Can I put the 'rotate 17' instruction into the httpd script (I don't 
mind all my Apache logs persisting for 4 months), or is there a better 
way do do exactly what I want?

TIA,

Roger

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________



More information about the Wylug-help mailing list