Restart the Tomcat script

Source: Internet
Author: User

Description: 8 tomcat running on a single server

Case in the way:

#!/bin/Bash#reboot Tomcat!!!#Author: FansikEcho-E"\033[1;42;31mchoice TOMCATNO REBOOT!!! \033[0m"Cat<<EOF1: Reboot tomcat80812: Reboot tomcat80823: Reboot tomcat80834: Reboot tomcat80845: Reboot tomcat80856: Reboot tomcat80867: Reboot tomcat80878: Reboot Tomcat8088eofread-TTen-P"Enter a mnumber:"Numbernumber=${number:-1} Caseinch    1) proid=`PS-ef |greptomcat8081 |grepjava |awk '{print $}'`        Kill-9$proIdSleep 5CD/usr/tomcats/tomcat8081RM-RF logs/* work./bin/startup.sh exit; 2) proid= ' Ps-ef | grep tomcat8082 | grep java |        awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8082 rm-rf logs/* work    ./bin/startup.sh exit;; 3) proid= ' Ps-ef | grep tomcat8083 | grep java |        awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8083 rm-rf logs/* work    ./bin/startup.sh exit;; 4) proid= ' Ps-ef | grep tomcat8084 | grep java |        awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8084 rm-rf logs/* work    ./bin/startup.sh exit;; 5) proid= ' Ps-ef | grep tomcat8085 | grep java |        awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8085 rm-rf logs/* work    ./bin/startup.sh exit;; 6) proid= ' Ps-ef | grep tomcat8086 | grep java | awk ' {priNT $ "kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8086 rm-rf logs/* work./bin/sta    Rtup.sh exit;; 7) proid= ' Ps-ef | grep tomcat8087 | grep java |        awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8087 rm-rf logs/* work    ./bin/startup.sh exit;; 8) proid= ' Ps-ef | grep tomcat8088 | grep java |        awk ' {print $} ' kill-9 $proId sleep 5 cd/usr/tomcats/tomcat8088 rm-rf logs/* work    ./bin/startup.sh exit;; *) echo "Please input 1-8" Esac

Restart the Tomcat script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.