Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/sharedra.../oldrads/crons
File: logcheck.sh
#!/bin/bash
[0] Fix | Delete
[1] Fix | Delete
if [ -f /etc/cpanel/ea4/is_ea4 ]; then
[2] Fix | Delete
LOGPATHS="/var/lib/mysql/ /var/log/ /var/log/apache2/ /var/log/apache2/domlogs/"
[3] Fix | Delete
else
[4] Fix | Delete
LOGPATHS="/var/lib/mysql/ /var/log/ /usr/local/apache/logs/ /usr/local/apache/domlogs/"
[5] Fix | Delete
fi
[6] Fix | Delete
TEMPLOG=/var/log/logfilesizecheck.${RANDOM}
[7] Fix | Delete
for LOGPATH in $LOGPATHS; do
[8] Fix | Delete
find $LOGPATH -maxdepth 1 -type f | xargs ls -al |sed '/ibdata/d'| awk -v alog="$TEMPLOG" '{ if($5 > 1825361100) print > alog;}'
[9] Fix | Delete
done
[10] Fix | Delete
[11] Fix | Delete
if [ -f $TEMPLOG ];then
[12] Fix | Delete
subject="large_log_files_detected"
[13] Fix | Delete
cat $TEMPLOG
[14] Fix | Delete
mail -s $subject sadmin-ra2@imhadmin.net< $TEMPLOG
[15] Fix | Delete
rm -rf $TEMPLOG
[16] Fix | Delete
fi
[17] Fix | Delete
[18] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function