3 # rotate the messages file if >= 4M
7 for i in /var/log/messages /var/log/sys.log /var/opt/apache2/logs/access_log /var/opt/apache2/logs/error_log; do
9 mess_size=`du -h $i | awk '{ print $1 }' | sed 's/.*k/0/' | awk -F. '{ print $1 }'`
10 if [ "$mess_size" -gt "3" ] ; then
13 echo "rotated $i file, touching empty file."
14 [ ! -f $i ] && touch $i
20 if [ "$dodel" = "1" ] ; then
21 echo "rotated files, restarting some services ..."
22 /etc/init.d/sysklogd stop
23 /etc/init.d/apache stop
25 /etc/init.d/sysklogd start
26 /etc/init.d/apache start