25th February, 2016 Crontab to remove log

When we receive a notification from AWS, we go check which webservers are down.
We ssh to the server and do
service jetty restart

Jetty crash log is under /home/jetty/hs_err_pid2390.log

Disk space can be checked by df -h

sudo vi /etc/sudoers
crontab -e
 * * * * *  find  /opt/jetty/logs/*.log.* -mtime +7 -exec sudo rm -f {} \;
 * * * * *  find  /opt/jetty/logs/audit/*.log.* -mtime +7 -exec sudo rm -f {} \;
 * * * * *  find  /opt/jetty/logs/app/*.log.* -mtime +7 -exec sudo rm -f {} \;
 * * * * *  find  /opt/jetty/logs/access/*.log.* -mtime +7 -exec sudo rm -f {} \;

Update Amazon Launch Configuration and Auto Scaling Group to change server configuration.

Comments