我创建了在CentOS机器上运行的Spring启动应用程序。 在应用程序运行时,在temp文件夹中创建了一些空目录,如下所示 - tomcat.xxxxxxxxxxxxxxx.8080
[root@CentOS-QA-125 backend-service]# cd /tmp/
[root@CentOS-QA-125 tmp]# ls
hsperfdata_nobody tomcat.4470692394951712929.8080 tomcat.7632125794043236543.8080
hsperfdata_root tomcat.4549830896347164779.8080 tomcat.7785504846258388922.8080
tomcat.4745791246199154712.8080 tomcat.7815834833588539762.8080
tomcat.118007245717039284.8080 tomcat.4851962228372473264.8080 tomcat.7824875841582997143.8080
tomcat.1313023034740625177.8080 tomcat.486137861122989407.8080 tomcat.785539555498439789.8080
tomcat.1334256488557704195.18080 tomcat.4981472070680071975.8080 tomcat.7897404027847452187.8080
tomcat.1361637523333369924.8080 tomcat.4997350422186621454.8080 tomcat.8298403342090061380.8080
tomcat.1454027871428296243.8080 tomcat.5096017063187125774.8080 tomcat.8456200677158959325.8080
tomcat.1468597706309242944.8080 tomcat.5183109189826449002.8080 tomcat.859127774801375492.8080
tomcat.1782179912761690122.8080 tomcat.5246047423134380844.8080 tomcat.8706261412802589755.8080
tomcat.1798168479970927044.8080 tomcat.5636031847701212066.8080 tomcat.8786479103113979810.8080
tomcat.1905491338162816307.8080 tomcat.5671250823815892425.8080 tomcat.8800584963400743657.8080
tomcat.1926407421149883221.18080 tomcat.5802754901492244418.8080 tomcat.8909628064306544136.8080
tomcat.2050642845396410198.8080 tomcat.5924561432335548181.8080 tomcat.8938301541068118051.8080
tomcat.2816928811999489865.8080 tomcat.594350763280186022.8080 tomcat.9213584206441849130.8080
tomcat.3155277784350207518.8080 tomcat.5963678300016740318.8080 tomcat-docbase.307198159312951369.8080
tomcat.3269295996451092693.8080 tomcat.603447849720662395.8080 tomcat-docbase.3650447568706516898.8080
tomcat.3296485328264645198.8080 tomcat.6126378381932430481.8080 tomcat-docbase.4418676716679207372.8080
tomcat.3478407594042395125.8080 tomcat.6298722759484433761.8080 tomcat-docbase.5455871628364634312.8080
tomcat.3568390261957689663.8080 tomcat.6506313869507286672.8080 tomcat-docbase.7102967207191677253.8080
tomcat.3582019931059397831.8080 tomcat.6600111490334966013.8080 tomcat-docbase.7724473308663758338.8080
tomcat.3690945660484868972.8080 tomcat.6664103181543225787.8080 tomcat-docbase.931779527920948070.8080
tomcat.3710144079209801015.8080 tomcat.6683066154461629639.8080 tomcat-docbase.932218040353239650.8080
tomcat.4154490372779164762.8080 tomcat.7016719473998097349.8080 appl
tomcat.4218042511249324079.8080 tomcat.711724724349148228.8080 appl
tomcat.4266966067732443088.8080 tomcat.7166943087383096944.8080
tomcat.4434690235718477600.8080 tomcat.7523973379731195016.8080
有没有办法限制或避免创建这些文件夹? 我们有什么方法可以将这些文件夹重定向到其他位置吗?
答案 0 :(得分:5)
您可以使用server.tomcat.basedir
控制目录的位置。如您所见,它默认为临时目录,但您可以根据需要配置其他位置。