« Creating a new drupal field | Main | Making a mods data stream for fedora. »

logrotate config files

Intro

Redhat uses the logrotate to manage the rotation of log files. The files end up in /var/log or a subdirectory of that directory.

Main logrotate config file ( /etc/logrotate.conf)

# see "man logrotate" for details
# rotate log files weekly
weekly
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
#compress
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    create 0664 root utmp
    rotate 1
}

Specific file for httpd (/etc/logrotate.d/httpd ) overrides file above

/var/log/httpd/*log {
# keep 52 weeks worth of backlogs  
    rotate 52
    missingok
    notifempty
    sharedscripts
    compress
    postrotate
        /sbin/service httpd reload > /dev/null 2>/dev/null || true
    endscript
}

TrackBack

TrackBack URL for this entry:
http://blog.lib.umn.edu/cgi-bin/mt-tb.cgi/85249

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)