Tomcat – Restart – Clear Temp and Clear Work Dir

Tomcat – Restart – Clear Temp and Clear Work Dir

Need assistance with or Considering a CMS or ECM System? Contact Us today! CAPPS is a full service EMC Velocity Partner. We can assist with requirements gathering, review, evaluation, procurement, implementation, training, and support of your ECM platform. CAPPS offers very competitive pricing on Documentum, ApplicationXtender, Captiva, SharePoint, and a variety of other industry leading ECM and CMS platforms. Contact Us Today! 954-769-0066 | sales@capps-llc.com




As many may be aware restarting tomcat is a necessary evil during the development cycle. Attached is a very useful batch file for restating Tomcat. One could create a job or method to run from DA or schedule a task on a periodic interval.

Copy and paste the text below into notepad and save as filename.cmd

ECHO OFF
REM # Tomcat Restart Script 0.2
REM # Content Application Systems, LLC – Shane McIntyre
REM # Stop the Tomcat Service
REM # Edit tomcat6 with the version of tomcat you are running e.g tomcat5 or tomcat6
net stop tomcat6
REM # Delete the cached JSP pages, needs to be done if any changes are made to java, best practice when restarting the service
del /f /s /q c:\tomcat\work\catalina\localhost
REM # Delete the contents of the tomcat Temp directory
del /f /s /q c:\tomcat\temp\
REM # Force a delete of the Documentum components, Tomcat will recreate this Automatically
del /f /s /q c:\tomcat\documentum
REM # Start the service append to a log file
net start tomcat6>>%temp%\Console.log

  • Share/Bookmark