technical skills grow

Responsive Ads Here

Tuesday, June 8, 2021

Write shell script for tomcat down it will up automatically again

 #!/bin/bash


cd /home/skymet/apache-tomcat-8.5.43/bin/

sh shutdown.sh

##################Kill_running_id#################
javaID=$(ps -ef | netstat -pltn | grep java | awk '{print $7}' | cut -d "/" -f1)

echo $javaID

#tomcatIDkill=$(ps -Af | grep "tomcat" | grep -v grep | awk '{print$2}' | xargs kill -9 )

##################Kill_tomcat_running_id#################
 

tomcatIDkill=$(ps -Af | grep "tomcat" | grep -v grep | awk '{print$2}' )


kill -9 $tomcatIDkill

sh startup.sh

Goto crontab :check every 15 mint

  */15  *  *  *  *  sh /root/it/private/geoserver_reset.sh
 




No comments:

Post a Comment

Powered by Blogger.

Labels

Contact Form

Name

Email *

Message *

Search This Blog

Blog Archive

Ad Code

Responsive Advertisement

Recent Posts