Ben
Ben

Reputation: 2801

JBoss Log File Maintenance/Cleanup

I am running JBoss 4.0.2 server and over the years it has created a large number of log files that I would like to clean up.

I would like to keep the same logging level but also have it delete any log files older than 3 months.

Is there a way to do that in the configuration or should I just write a perl script?

Thanks.

Upvotes: 1

Views: 1893

Answers (1)

David Rabinowitz
David Rabinowitz

Reputation: 30448

Put this in a cron job:

find /var/log/jbossas/default/ -mtime +90 | xargs rm -f

See more on the unix find command

We also run the following in order to save disk space. It compresses all files who are at least 3 days old

find /var/log/jbossas/default/ -mtime +3 -name \*.log | xargs bzip2

Upvotes: 1

Related Questions