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