LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   crontab job to restart tomcat... (https://www.linuxquestions.org/questions/programming-9/crontab-job-to-restart-tomcat-116913/)

barbean 11-17-2003 12:58 AM

crontab job to restart tomcat...
 
Hi all,

My platform: redhat8, tomcat4.1.24
I have a weekly restart tomcat job defined by "crontab -e" below:

# run at 2 am on Saturday: restart tomcat & rename log file
0 2 * * 6 /usr/local/tomcat/bin/housekeep.sh

housekeep.sh as below:

DATE=`date "+%Y-%m-%d"`
/usr/local/tomcat/bin/shutdown.sh
cd /usr/local/tomcat/logs
mv catalina.out catalina.$DATE.out
/usr/local/tomcat/bin/startup.sh

Problem:
If I run housekeep.sh directly, it return what I want: catalina.out renamed and a new catalina.out created.
But when it is triggered by cron job, catalina.out renamed without catalina.out created, and all message still write to the renamed catalina.out file (i.e. catalina.2003-11-17.out)

anything wrong with me?
thx
barbean


All times are GMT -5. The time now is 05:23 PM.