Catalina. out in Tomcat continues to accumulate the problem. Solution: tomcatcatalina. out
This method does not require you to modify the Tomcat configuration for beta testing. It is available.
1. Add the file clear_log.sh In the tomcat bin directory.
The content is as follows:
#! /Bin/sh
D = 'date + % Y-% m-% d'
D7 = 'date-d' 7 day ago '+ % Y-% m-% d'
Cp/opt/apache-tomcat-8.5.9/logs/catalina. out/opt/apache-tomcat-8.5.9/logs/catalina. $ {d}. log
Echo "">/opt/apache-tomcat-8.5.9/logs/catalina. out
Rm-rf/opt/apache-tomcat-8.5.9/logs/catalina. $ {d7}. log
2. Add the sh file to the operation permission
Chmod + x/opt/apache-tomcat-8.5.9/bin/clear_log.sh
3. Add the/etc/crontab file (timer) at the bottom of the document (execute the script at 00:01 every day ):
1 0 * root/opt/apache-tomcat-8.5.9/bin/clear_log.sh
4. Load the crontab file
Crontab-u root/etc/crontab
5. Restart crontab
/Etc/init. d/crond restart
6. View scheduled tasks
Crontab-l