vi clean.sh
logs_path="/appqqq/tomcat/logs"
find $logs_path -mtime +3 -name "localhost.*.log" -exec rm -rf {} \;
find $logs_path -mtime +3 -name "localhost_access_log.*.txt" -exec rm -rf {} \;
find $logs_path -mtime +3 -name "catalina.*.log" -exec rm -rf {} \;
find $logs_path -mtime +3 -name "manager.*.log" -exec rm -rf {} \;
find $logs_path -mtime +3 -name "host-manager.*.log" -exec rm -rf {} \;
find $logs_path -mtime +3 -name "fileservice.log.*" -exec rm -rf {} \;
>$logs_path/catalina.out;
chmod 777 clean.sh
crontab -e
0 2 * * * sh /appqqq/tomcat/logs/clean.sh