Hello readers,
While developing with Taskspace I find myself often restarting tomcat on Windows.
A quick method to do this is a BAT file to also clear the cache folders.
Below you will find the script.
@echo OFF
:stop
@echo stopping service
sc stop tomcat6
ping 127.0.0.1 -n 20 -w 1000 > nul
sc query tomcat6
find /I "STATE"
find "STOPPED"
if errorlevel 0 goto start
goto stop
:start
@echo removing work
rmdir /S /Q "C:\Program Files\Apache Software Foundation\Tomcat 6.0\work"
@echo removing temp
rmdir /S /Q "C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp"
@echo making new temp dir
mkdir "C:\Program Files\Apache Software Foundation\Tomcat 6.0\temp"
@echo removing presets
rmdir /S /Q "C:\Program Files\Apache Software Foundation\Tomcat 6.0\documentum\presets"
@echo removing cache
rmdir /S /Q "C:\Program Files\Apache Software Foundation\Tomcat 6.0\documentum\cache"
ping 127.0.0.1 -n 3 -w 1000 > nul
@echo starting service
sc start tomcat6
Kind regards, Marcus
This can get me out of my tomcat issues. Thanks.
ReplyDeletemark emails on tomcat