Re: Weird Disk Spac Problem [message #32863 is a reply to message #32795] |
Thu, 04 September 2008 14:51  |
kenjy
Messages: 50 Registered: July 2008 Location: Mexico
|
Member |
|
|
You need to correctly log rotate your ssl_mutex log file, well I think that this is the problem:
httpd 9712 apache 710w REG 0,20 0 13369352 (deleted) /var/log/httpd/ssl_mutex
httpd 9713 apache 710w REG 0,20 0 13369352 (deleted) /var/log/httpd/ssl_mutex
You have a deleted file who is growing in some way. I fix it adding this to log rotate but this is in nginx web server with this script, obviously it works rotating logs each night because we want a log each night (my logs are about 2gb so I need to make a slide at the middle of the day):
www:/opt/mantenimiento# cat nginx_logs.sh
#Obtenemos la hora actual, dependiendo de si son las 00 o las 12 se rotara el log
hora=$(date +%H)
ayer=$(date -d yesterday +%Y-%m-%d)
hoy=$(date +%Y-%m-%d)
ruta=/var/log/nginx
if [ "$hora" = "00" ]; then
mv $ruta/access.log $ruta/jornada_access_$ayer-12.log
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
cat $ruta/jornada_access_$ayer-12.log >> /$ruta/jornada_access_$ayer-00.log
mv $ruta/jornada_access_$ayer-00.log $ruta/jornada_access_$ayer.log
rm $ruta/jornada_access_$ayer-12.log
gzip -9 $ruta/jornada_access_$ayer.log
elif [ "$hora" = "12" ]; then
mv $ruta/access.log $ruta/jornada_access_$hoy-00.log
if [ -f /var/run/nginx.pid ]; then
kill -USR1 `cat /var/run/nginx.pid`
fi
else
echo "No se procesa, fuera de hora."
fi
www:/opt/mantenimiento#
http://kenjy.net |Live net !!!
|
|
|