tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Funk <funk...@joedog.org>
Subject Re: Shell script to check if Tomcat is running?
Date Tue, 02 Dec 2003 00:37:26 GMT
2 really simple ways


-----------------------------
# Assume tomcat is the only java process
COWBELL=`ps -ef | grep java| grep -v grep | wc -l`
if [ $COWBELL > 0 ]; then
   echo "Woohoo - the process is there";
fi
-----------------------------

OR

-----------------------------
# Assume glodenfile should be result from url below
rm dest_file.html
wget http://more/cowbell.txt --output-document=dest_file.html
COWBELL=`diff dest_file.html goldenfile.html  | wc -l`
if [ $COWBELL == 0 ]; then
   echo "Woohoo - the site is up (and not hacked)";
else
   echo "The downloaded page is diff from the golden file"
fi
-----------------------------


-Tim

Tom Ly wrote:

> I plan on using cron to automatically run a script to check if Tomcat is running.  How
would I write one?
>  
> -Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message