Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JBoss AS 7: How to clean up tmp?

I noticed that in my JBoss Application Server 7 installation under standalone/tmp I have 400 MB of files related to past deployments, some of them a few months old.

How is it cleaned up? Should it happen automatically? Is there a tool for it? Can I just remove all those files myself?

like image 628
Konrad Garus Avatar asked Mar 24 '12 12:03

Konrad Garus


People also ask

Can we delete tmp folder in JBoss?

You could actually delete the whole tmp directory. Jboss will recreate it at the next startup.

What is data folder in JBoss?

The data/content folder is an internal folder to store the managed deployments. JBoss will not delete this folder unless you use the management to undeploy it. So I suppose there is some kind of external process which delete this folder for some reason.


1 Answers

As you know JBoss is a purely filesystem based installation. To install you simply unzip a file and thats it. Once you install a certain folder structure is created by default and as you run the JBoss instance for the first time, it creates additional folders for runtime operation. For comparison here is the structure of JBoss AS 7 before and after you start for the first time

Before

jboss-as-7  |  |---> standalone  |      |----> lib  |      |----> configuration  |      |----> deployments  |        |---> domain  |.... 

After

jboss-as-7      |      |---> standalone      |      |----> lib      |      |----> configuration      |      |----> deployments      |      |----> tmp      |      |----> data      |      |----> log      |            |---> domain      |.... 

As you can see 3 new folders are created (log, data & tmp). These folders can all be deleted without effecting the application deployed in deployments folder unless your application generated Data that's stored in those folders. In development, its ok to delete all these 3 new folders assuming you don't have any need for the logs and data stored in "data" directory.

For production, ITS NOT RECOMMENDED to delete these folders as there maybe application generated data that stores certain state of the application. For ex, in the data folder, the appserver can save critical Tx rollback logs. So contact your JBoss Administrator if you need to delete those folders for any reason in production.

Good luck!

like image 100
uaarkoti Avatar answered Sep 25 '22 17:09

uaarkoti