LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-17-2003, 01:58 AM   #1
barbean
LQ Newbie
 
Registered: Oct 2003
Posts: 4

Rep: Reputation: 0
Unhappy 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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
skip the crontab job for one time ust Linux - General 2 04-20-2005 04:01 AM
crontab job entry notolerance Linux - Software 2 02-20-2005 03:40 PM
Can I get a konsole to start from a crontab job? davee Linux - Newbie 2 03-05-2004 06:22 AM
adding a job to crontab via shell script tazio Linux - General 7 10-23-2003 03:44 PM
Setting global variables from a crontab job davee Programming 2 10-06-2003 08:05 AM


All times are GMT -5. The time now is 03:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration