|
|||
|
I´m having a problem with apache error_log file at /usr/local/apache/logs/
I have deleted and created the file on monday and today is 6.3gb again, seems that is not rotating the logs daily. I´ve 404.shtml files in all the accounts -rw-r--r-- 1 root root 6.3G Jun 4 14:02 error_log any help? |
|
||||
|
Quote:
Unlike user's HTTP logs, these logs will be rotated once they reach 300 MB in size.
__________________
Want our technical analysts to login to your server to assist you? You can contact our technical analysts at: http://tickets.cPanel.net/submit |
|
|||
|
cPanelDavidG, what about the error_log files that are located within the individual hosted accounts? I just found one error_log file in someone's account that was over 600,000 lines deep! Anything we can do to keep these from eating up web space, that is, without switching this feature off entirely in php.ini?
|
|
|||
|
Quote:
This si really your customer's problem and not yours directly - and you should contact your customer and tell them to either fix whatever is broken and generating the huge files or tell them to go elsewhere.... or just delete the error logs yourself once in a while. Mike |
|
|||
|
But I am sure, as you probably know there are scripting errors which have no real impact on their scripts or anything else.
True, such errors are due to poor coding, etc. but in our view, the last thing we need are accounts failing due to "unknown" reasons. (from the customer's point of view) And, ANYTHING to reduce support calls is a plus. So I take it then, that it is up to us to come up with a script that regularly looks at the size of the error_log files and rotates them when they get too large? |
|
||||
|
We have a cronjob that sweeps error_logs from all user accounts regularly
and checks the size before deletion and the number of times it has to sweep that particular user and above a certain threshold, it sends us an email to go check out the user's account. Regarding Mr. 6 GB though, it would seem you have a major problem because there is no way the default log for the server should be growing that fast unless there is something going on that there shouldn't be.
__________________
My Server Expert: Server support, security, and management! |
|
|||
|
Spiral, sounds like just what the doctor ordered.
Care to post the script that's run by your cron? Last time I tried to set up a shell script to do something like this it caused CPU overloads. I'm really not very good at this kind of thing. |
|
||||
|
Quote:
However, someone in another thread asked almost an identical question about error_logs literally just a couple of minutes ago and I wrote them a quick script to locate and archive the error_log files so here is a variation of the script I just posted in the other thread just a minute ago except rewritten to be more used as a cronjob and may be useful to what you are doing as well and should be easily modified to add whatever additional functionality you need: Code:
#!/bin/bash
IFS="$"
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin:/usr/mbin:.
export PATH
unset USERNAME
TLOG="/tmp/tmp_error_search.$$"
ELOG="/var/log/client_error_logs.log
# Reset temporary work file if exists
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 ..." >> ${ELOG}
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 ..." >> ${ELOG}
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 ..." >> ${ELOG}
fi
echo "$(date) Compressing ${MLINE} into new bzip2 archive ..." >> ${ELOG}
bzip2 -9 "${MLINE}" > /dev/null 2>&1
done
rm -f ${TLOG}
fi
__________________
My Server Expert: Server support, security, and management! Last edited by Spiral; 07-11-2009 at 05:44 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error_log File | cancer10 | cPanel and WHM Discussions | 3 | 05-13-2008 01:33 AM |
| error_log file in every directory? | nurseryboy | cPanel and WHM Discussions | 2 | 12-13-2006 12:38 PM |
| site-log 6GB | Adrnalnrsh | cPanel and WHM Discussions | 0 | 06-29-2006 07:16 PM |
| Why isn't rotatelog used for rotating the access_log and error_log files? | anup123 | cPanel and WHM Discussions | 3 | 11-30-2004 03:11 PM |
| is this normal in the error_log file ? | silvernetuk | cPanel and WHM Discussions | 1 | 12-11-2002 03:31 PM |