
# Tomcat

#to delete tar.gz older then 1 day files every midnight:
0  0  *  *  * root find /usr/share/tomcat/default/logs -type f -mtime +15 | xargs --no-run-if-empty rm
0  0  *  *  * root find /usr/share/tomcat/default/logs -type f -mtime +2 -size +50M | xargs --no-run-if-empty rm
0 */1 * * * root find /usr/share/tomcat/default/temp -type f -name "*.zip" -mmin +30 | xargs --no-run-if-empty rm
# every 10 hours delete access_tomcat logs older then 10 hours
0 */10 * * * root find /usr/share/tomcat/default/logs -type f -name "access_tomcat.*" -mmin +600 | xargs --no-run-if-empty rm
# every 5 hours delete tomcat logs older then 5 hours and larger then 1G
0 */5 * * * root find /usr/share/tomcat/default/logs -type f -size +1G -mmin +300 | xargs --no-run-if-empty rm

# System messages

*/3 * * * * root find /var/log/ -type f -name messages | xargs --no-run-if-empty chgrp adm
*/3 * * * * root find /var/log/ -type f -name messages | xargs --no-run-if-empty chmod g+r
