Tomcat Auto-Updated version of the script

Source: Internet
Author: User

Script implementation purposes:

Update the war package with SVN to delete the cache at the same time.

Turn Tomcat off completely and start Tomcat with the specified user.

Considerations:

The execution function is: zzz01

The Tomcat path is/usr/local

Start tomcat user for www

Note the use of Xargs

#!/bin/bash

function zzz01 () {

Su-www-c "Rm-rf/usr/local/tomcat_imp_stockrecord1/webapps/imp-stockrecord-web"

Su-www-c "rm-rf/usr/local/tomcat_imp_stockrecord1/work/*"

Su-www-c "SVN Up/usr/local/tomcat_imp_stockrecord1/webapps/imp-stockrecord-web.war"

Su-www-c "Sh/usr/local/tomcat_imp_stockrecord1/bin/startup.sh"

}

Sh/usr/local/tomcat_imp_stockrecord1/bin/shutdown.sh>/dev/null 2>&1

Sh/usr/local/tomcat_imp_stockrecord1/bin/shutdown.sh>/dev/null 2>&1

Sleep 3

Num= ' Ps-ef|grep tomcat_imp_stockrecord1|grep-v Grep|awk ' {print $} '

#echo $num

If ["$num" = ""];then

echo " close successfully and update in ======================="

Zzz01

Else

echo $num |xargs Kill

Sleep 2

Zzz01

Fi


This article is from the "Ten Years Sword-Breeze" blog, please be sure to keep this source http://jingfeng.blog.51cto.com/9152964/1879899

Tomcat Auto-Updated version of the 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.