[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] configuring log rotation



after reading some of the posts on log rotation and after reading "man
logrotate", I've decided
to try the following unless or until I hear differently from one of you.   I
have a Cobalt
RAQ4 dedicated server at Verio.  It seems to be configured oddly or at least it
doesn't seem
to match up exactly with what I'm reading

as i said in a previous message, I want to capture log information for my site
in web.log
month by month and compress and save 3 months of logs.  the current "web.log"
for
the site runs from Feb. 9 to today.  The gz'd log runs from Jan 16 to Feb. 9 (25
days?).

I found the directory logrotate.d in etc with a site1 (www.boone.org) file in
it.
I also found files logrotate.conf and logrotate.conf.master in etc.

I am thinking I should alter the present "site 1" file which now reads:

/home/sites/site1/logs/mail.log {
   missingok
   compress
   size 20M
}

/home/sites/site1/logs/ftp.log {
   missingok
   compress
   size 20M
}

/home/sites/site1/logs/web.log {
   missingok
   compress
   size 20M
}

to read this way:

/home/sites/site1/logs/mail.log {
   monthly
   rotate 3
   nomissingok
   compress
}

/home/sites/site1/logs/ftp.log {
   monthly
   rotate 3
   nomissingok
   compress
}

/home/sites/site1/logs/web.log {
   monthly
   rotate 3
   nomissingok
   compress
}

I'm think I should alter the logrotate.conf file which now reads:

# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 1

# send errors to root
errors root

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
compress

# Put in a generic size limit so things don't go wild
size 1M

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    size 2M
    create 0664 root root
    rotate 1
}

# system-specific logs may be configured here


TO READ AS FOLLOWS:

# see "man logrotate" for details
# rotate log files monthly
monthly

# keep 3 months worth of backlogs
rotate 3

# send errors to root
errors root

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
compress

# Put in a generic size limit so things don't go wild
size 1M

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp -- we'll rotate them here
/var/log/wtmp {
    monthly
    size 2M
    create 0664 root root
    rotate 1
}

# system-specific logs may be configured here

#errors webmaster@xxxxxxxxx
compress

"/var/log/httpd/site1-access.log" {
 monthly
 rotate 4
 postrotate
                    /sbin/killall -HUP httpd
 endscript
}

Will someone get back to me on this?  Thank you.