Linux - Simple script to remove apache log, Clear apache log file

Simple script to remove apache log

The below script will help you to find and remove apache log

ls -t apache2/error.log* | while read f; do ls -lh $f; n=$(echo $f | cut -d . -f3); 
echo $n;  if test "$n" -gt 20 ; then echo "y : rm $f"; rm -rf $f;  fi ;done

# ls -lSrh $(find -type f)

The topic on Linux - Simple script to remove apache log is posted by - Math

Hope you have enjoyed, Linux - Simple script to remove apache logThanks for your time

Tech Bluff