View Full Version : logrotate.conf - comments

12-29-2003, 07:54 PM
Hi I've edited my logrotate.conf file & was hoping that some kind soul would comment on it to see if I'm doing anything wrong.

rotate 5

/var/log/httpd/access_log /var/log/httpd/error_log {
rotate 5
errors me@abc.com
mail me@abc.com
kill -HUP `cat /var/run/httpd.pid`

/var/log/maillog {

include /etc/logrotate.d

Do i need to repeat the compress command which is already at the top & then in between the Prerotate script - So by putting mail to me in the postrotate script it the log file would mail to me after it is rotated right ?

And the prerotate script - means that at every week it will be rotated & compressed into the archive up to five weeks ?

Just to double confirm thanks.

12-30-2003, 02:06 AM
Looks OK to me.
If you have stuff in the 'global' section (thats the first four lines in your case) I don't think they need repeating in the sections. Not a problem if they are.
I tried the 'mail ...' command but the gzipped file that I got wasn't MIME encoded properly. I may be that my mailer couldn't read it. In which case it maybe better to mail the file without compression.

12-31-2003, 12:44 AM
Thanks Jalal, if I dont compress the log file it would be too big & would eat up the bandwidth then.
curious - if your mail system doesnt recognize the zipped file - would that be a case of you being on a nix based system ? or u are on window$

Sorry just checked the prerotation shell script, which is actually for the use in webalizer or urchin .? Since when did WH provide urchin ?

So I reckon that the prerotate script is not needed ?
And another thing is, i would like to name the compressed file name after my site - how do i do that ?

Have final thing to add, i cant find /var/run/httpd.pid ? there's only ftp.allpid ?

01-01-2004, 07:14 AM
The zip file: is actually a gzip file. Its not that the mailer doesn't recognize it, its just that whatever logrotate uses to send the mail is not mime encoding it. I haven't got around to looking into what is happening though, its not a big deal for me at present.