#! /bin/sh
#
# apache	Rotate the apache logsfiles daily.
#

[ -d /var/log/apache-httpd/. ] || exit 0
umask 022

# Take care of the standard logfiles.
cd /var/log/apache-httpd
if [ -f access_log ]
then
  savelog -c 7 access_log > /dev/null
fi
if [ -f error_log ]
then
  savelog -c 7 error_log > /dev/null
fi

# Send a reload signal to the apache server.
if [ -f /var/run/apache.pid ]
then
  kill -1 `cat /var/run/apache.pid` 2>/dev/null
fi
