Mar 08 2008

Logrotate

Published by blake

3.7 Logrotate

Set up any log rotations you want by putting configure files into /etc/logrotate.d. The only logs I need to configure are the Apache web logs for each website I run. The following logrotate setup handles them all at once:

  • cd /etc/logrotate.d
  • sudo vi apache

Add the following:

/var/log/httpd/*/*_log {

# rotate log files daily
daily

# keep x days of backlogs
rotate 14

missingok
nocompress
sharedscripts
postrotate

service apache graceful

endscript

}

Save and exit. Check the man pages of logrotate for more info on each option.

  • Digg
  • del.icio.us
  • description
  • Slashdot
  • StumbleUpon

Trackback URI | Comments RSS

Leave a Reply