:::: MENU ::::

Apache Tomcat – Get logs directly cleaned with rotation

  • Oct 19 / 2016
  • 0
Linux

Apache Tomcat – Get logs directly cleaned with rotation

Tomcat allows you to rotate easily your log files with AccessLogValve but it can be more difficult to get cleaning in logs directories automatically.

For that, you can easily use some smart find commands combined with actions:

  1. Get logs older than 3 days compressed so they can be smaller but still accessible
  2. Get logs older than 60 days deleted permanently

You will probably have to adjust the logs path depending on your needs, and you can also modify the retention time for each action.
Once the command looks correct with what you’re expecting, you can set them up as cron so it can be executed automatically every day.

Share...Share on Google+Tweet about this on TwitterShare on RedditShare on LinkedInShare on FacebookEmail this to someone

Comments are closed.

Question ? Contact