LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 12: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



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 03:01 AM
crontab job entry notolerance Linux - Software 2 02-20-2005 02:40 PM
Can I get a konsole to start from a crontab job? davee Linux - Newbie 2 03-05-2004 05:22 AM
adding a job to crontab via shell script tazio Linux - General 7 10-23-2003 02:44 PM
Setting global variables from a crontab job davee Programming 2 10-06-2003 07:05 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:32 AM.

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
Open Source Consulting | Domain Registration