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

[cobalt-users] Regarding: daily log rotation



Hi 

    We are using Cobalt raq4r.  Everyday at mid night during the 
log rotation, the load is getting too high and sometimes we have to
restart the server due to the high load.  Though the /var 74% space
has been used. We are moving the zipped files which are being created
for log rotation but again when the log rotates it is consuming the 
total spaces and showing */var space has been get less*... 

    Every day log rotation time is  really a pain for us.  Can anyone
help me out - how can we make log rotation a smooth process.. Here i am
giving our log rotation script...

Thanks in advance..



***** /etc/cron.daily/lograte is as follows:
--------------------------------------------
/usr/sbin/logrotate /etc/logrotate.conf

--------------------------------------------

***** /etc/logrotate.conf is as follows:::

--------------------------------------------
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
}
 
--------------------------------------------

***** /etc/logrotate.d  directory is as follows:

---------------------------------------------
server [root cron.daily]# cd /etc/logrotate.d
server [root logrotate.d]# ls
1          mgetty    site12  site2   site31  site46  site54  site61  site69
analog     mysql     site13  site20  site32  site47  site55  site62  site7
apache     postgres  site14  site21  site34  site48  site56  site63  site70
chiliasp   proftpd   site15  site22  site35  site49  site57  site64  site71
cobalt     samba     site16  site23  site36  site5   site58  site65  site72
cron       site1     site17  site24  site37  site50  site59  site66  site8
home       site10    site18  site26  site38  site51  site6   site67  site9
majordomo  site11    site19  site30  site4   site52  site60  site68  syslog
server [root logrotate.d]#
---------------------------------------------

*****  analog file is as follows::

/var/cache/analog.dns {
        missingok
        compress
        rotate 1
        size 20M
}
---------------------------------------------

******* apache file is as follows::

/var/log/httpd/access {
    prerotate
        /usr/local/sbin/split_logs web < /var/log/httpd/access
    endscript
    missingok
    postrotate
        /usr/bin/killall -HUP httpd 2> /dev/null || true
    endscript
    daily
}

/var/log/httpd/agent_log {
    missingok
    postrotate
        /usr/bin/killall -HUP httpd 2> /dev/null || true
    endscript
}

/var/log/httpd/error {
    missingok
    postrotate
        /usr/bin/killall -HUP httpd 2> /dev/null || true
    endscript
}

/var/log/httpd/referer_log {
    missingok
    postrotate
        /usr/bin/killall -HUP httpd 2> /dev/null || true
    endscript
}

/var/log/httpd/fpexec_log {
    missingok
    postrotate
        /usr/bin/killall -USR1 httpd 2> /dev/null || true
    endscript
}

/var/log/httpd/suexec_log {
    missingok
    postrotate
        /usr/bin/killall -USR1 httpd 2> /dev/null || true
    endscript
}
---------------------------------------------
*****  cobalt file is as follows:

/var/cobalt/modem.log {
        missingok
        compress
        rotate 1
        monthly
        size 6k
}

/var/cobalt/telnet.log {
        missingok
        compress
        rotate 1
        monthly
        size 6k
}

/var/log/mgetty.log.modem {
        missingok
        compress
        rotate 1
        monthly
        size 6k
}

/var/cobalt/adm.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/atalk.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}
/var/cobalt/cpu.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/crond.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/dns.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/filesystem.log {
    missingok
    compress
    rotate 1
    monthly
    size 10k
}

/var/cobalt/ftp.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}
/var/cobalt/groupspace.log {
    missingok
    compress
    rotate 1
    monthly
    size 10k
}

/var/cobalt/inetd.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/lcd.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/mail.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/mem.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}
/var/cobalt/net.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/nfs.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/ntp.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/portmap.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/smb.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}
/var/cobalt/snmp.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/ssl.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/userspace.log {
    missingok
    compress
    rotate 1
    monthly
    size 10k
}

/var/cobalt/www.log {
    missingok
    compress
    rotate 1
    monthly
    size 6k
}

/var/cobalt/sauce.log {
    missingok
    compress
    rotate 2
    monthly
    size 300k
}
/var/log/httpd/combined-access {
   missingok
   compress
   size 30M
}
-------------------------------------------------------
*****  cron file is as follows:

/var/log/cron {
    missingok
    notifempty
    postrotate
        /bin/kill -HUP `/bin/cat /var/run/crond.pid`
    endscript
}
~-------------------------------------------------------
**** home file is as follows:

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

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

/home/sites/home/logs/web.log {
   missingok
   compress
   size 250M
}
----------------------------------------------------------
**** majordomo file is as follows:
/usr/local/majordomo/log {
        missingok
        compress
        rotate 1
        monthly
        size 100k
}
----------------------------------------------------------
****  mysql file is as follows::  for mysql we are already using different
server
      but do we need this log rotatoin???

/var/lib/mysql/mysqld.log {
        # create 600 mysql mysql
        notifempty
        daily
        rotate 3
        missingok
        compress
    postrotate
        # just if mysqld is really running
        if test -n "`ps acx|grep mysqld`"; then
                /usr/bin/mysqladmin flush-logs
        fi
    endscript
}
-----------------------------------------------------------
***** postgresql is as folows::

/var/log/postgresql {
        compress
        rotate 2
        weekly
}
-----------------------------------------------------------
**** proftpd file is as follows::

/var/log/xferlog {
        missingok
        prerotate
                /usr/local/sbin/ftplog2commonlog < /var/log/xferlog | \
                        /usr/local/sbin/split_logs ftp
        endscript
        daily
    # ftpd doesn't handle SIGHUP properly
    nocompress
}

~---------------------------------------------------------------
**** samba file is as follows:::

/var/log/samba/log.* {
    notifempty
    missingok
    postrotate
        /usr/bin/killall -HUP nmbd
    endscript
}
~
~--------------------------------------------------------------
**** now for every site[nn]  the file is as follows, some of the file
is using size 20M some of the sites are using 10M only the difference

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

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

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

***** syslog file is as follows::

/var/log/kernel {
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
}

/var/log/messages {
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
}

/var/log/secure {
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
}

/var/log/auth {
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
}

/var/log/maillog {
    prerotate
        /usr/local/sbin/maillog2commonlog.pl sendmail < /var/log/maillog | \
            /usr/local/sbin/split_logs mail
    endscript
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
    daily
}

/var/log/spooler {
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
}
/var/log/boot.log {
    postrotate
        /usr/bin/killall -HUP syslogd
    endscript
}
---------------------------------------------------------------------

~




__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com