Tomcat Server creating Directories in tmp
Unfortunately, both embedded and non-embedded Tomcat needs to have a directory to store temporary files. This is not configurable, however, you can specify the directory in which Tomcat stores these temporary files using setBaseDir
.
This should be the first method called public void setBaseDir(String basedir)
and if it is not specified in your code it will look for it in
system properties - catalina.base, catalina.home - $HOME/tomcat.$PORT
By knowing the location I recommend writing a simple scheduled script that checks every so often and removes the files under that directory.