logrotate

J dreadpiratejeff at gmail.com
Sat Jun 19 15:55:18 UTC 2010


On Sat, Jun 19, 2010 at 04:32, Kaushal Shriyan <kaushalshriyan at gmail.com> wrote:
> Hi
> I am calling logrotate using shell script. Below are the details
> #!/bin/bash
> /usr/sbin/logrotate /usr/local/bin/scripts/logrotate-tomcat1-catalina.conf >
> /tmp/tomcat1.log 2>&1
> if [ $? -ne 0 ] ; then
> echo "Problems." | /usr/bin/mail -s "[CRON] hosttest compress tomcat1
> catalina.log - problems" kaushal at example.com
> fi
> The issue i am facing is that logrotate leads high load due to big log size
> if i make use of ionice utility
> /usr/bin/ionice -c3 /usr/sbin/logrotate
> /usr/local/bin/scripts/logrotate-tomcat1-catalina.conf > /tmp/tomcat1.log
> 2>&1
> is that correct?

Instead of manually rotating the log, why don't you put your conf file
in /etc/logrotate.d and add a size limitation?  that keeps your log
file from getting to be too big.  Look at 'man logrotate' and there's
an example config that shows how to do it...

IMHO, it's preferrable to keep 20 smaller logfiles than 5 giant
logfiles... and if you're getting a noticable load just rotating them,
how big are they anyway?

This could be a good use case for having a remote log server, too...




More information about the ubuntu-users mailing list