logrotate

Mario Vukelic mario.vukelic at dantian.org
Fri Sep 26 17:03:02 UTC 2008


On Fri, 2008-09-26 at 18:49 +0530, Kaushal Shriyan wrote:
> My Bash script is as below
> 
> #cat /usr/local/bin/scripts/call-logrotate-tomcat-sms-catalina
> 
> #!/bin/bash
> 
> /usr/sbin/logrotate /usr/local/bin/scripts/logrotate-tomcat-sms-catalina.conf > /tmp/log 2>&1
> 
> if [[ $? -eq 0 ]] ;then
> echo "Successful." | /usr/bin/nail -n -s "[CRON] host0086 compress
> tomcat-sms catalina.log - success"
> kaushal at example.com,ravik at example.com,umang at example.com
> else
> echo "Problems." | /usr/bin/nail -n -s "[CRON] host0086 compress
> tomcat-sms catalina.log - problems"
> kaushal at example.com,ravik at example.com,umang at example.com 
> fi
> 
> Please let me know if I am doing wrong

I'm not sure what you are trying to achieve and why you go about it the
way you do. Usually, one would simply put a simple config file
into /etc/logrotate.d and let cron take care of it. Compare the files
that are already in this directory, and also review /etc/logrotate.conf





More information about the ubuntu-users mailing list