I believe this may possibly have to do with a recent Cpanel update on server
running Apache 2.2.11 but I am still investigating the issue but I have seen
several hundred servers start generating large error_log files in the locations
where scripts are run shortly after applying recent Cpanel updates.
As for what to do with the error_log files, they are easy to locate and
then sweep or archive how ever you would like. This basic example
just simply deletes the files but you could expand to do what you wish:
Code:
#!/bin/bash
IFS=""$"
cd /home
ls /var/cpanel/users | while read CPLN; do
find ./${CPLN}/public_html -type f -name 'error_log' | xargs rm -f
done
A little more sophisticated approach, archiving the files:
Code:
#!/bin/bash
IFS="$"
TLOG="/tmp/tmp_error_search.$$"
if [ -e ${TLOG} ]; then
rm -f ${TLOG}
/bin/touch ${TLOG}
/bin/chmod 600 ${TLOG}
fi
cd /home #Nice starting point
ls /var/cpanel/users | while read CPLN; do
echo "$(date) I will now search ${CPLN}'s account for PHP error_log files ..."
find /home/${CPLN}/public_html -type f -name 'error_log' > ${TLOG}
done
if [ -e ${TLOG} ]; then
echo "$(date) I have built my list of error_log files and am now archiving those files ..."
cat ${TLOG} | while read MLINE; do
if [ -e ${MLINE}.bz2 ]; then
rm -f ${MLINE}.bz2
echo "$(date) Removed old archive ${MLINE}.bz2 from hard drive ..."
fi
echo "$(date) Compressing ${MLINE} into new bzip2 archive ..."
bzip2 -9 "${MLINE}"
done
rm -f ${TLOG}
fi
echo "$(date) Finished processing user error_log files ..."
# End of Script