Windows system Tomcat restart batch processing script

Source: Internet
Author: User
Tags tomcat


The Tomcat restart script is sent to the JSP environment O & M colleagues who need it ~

Running environment: XP/windows 2003 has passed the test, and other environments have not been tested due to the constraints on hand;

Script function: Adds a false-positive judgment to the closed/restart script that comes with tomcat for routine calls. If the script is suspended, Kill the relevant JAVA process;

Script features: it can be used on the tomcat/Jboss/apache hybrid platform, and only restart tomcat-related processes;

Note: Check whether the tomcat environment variables are correct.

@ Echo off
Title Tomcat heavy? Malaria? Br/> call "% tomcat_home % \ bin \ shutdown. bat"
Ping-n 6 127.1> nul
Wmic process where name = "java.exe" get processid, commandline | findstr/I "tomcat"> #
Setlocal enabledelayedexpansion
For/f "delims = *" % I in (#) do (
Set var = % I
Set var =! Var: start = #!
For/f "tokens = 2 delims = #" % a in ("! Var! ") Do (
Set tomcatpid = %
    )
)
Del #> nul
If defined tomcatpid taskkill/pid! Tomcatpid!
Ping-n 3 127.1> nul
Call "% tomcat_home % \ bin \ startup. bat"
Exit

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.