delCatalinaLogs.sh

  sre

5ff52d525fe524184.png_fo742.png

“`bash
#!/bin/bash
#Oct,20, to clean catalina logs quickly.
logPATH=/opt/SucTomcat/logs
DaysToRemain=30

if [ -d "logPATH" ]; then #avoid to mismatch.
cd
logPATH
cat /dev/null >catalina.out
find . -ctime +$DaysToRemain -type f | xargs rm -f
else
echo 'No logPATH found!'
fi

“`

LEAVE A COMMENT

Captcha Code