apache graceful重启

#!/bin/bash
dir=/home/bbs-backup/user-login
logdir=/usr/local/apache/logs
year=`date +%Y`
mouth=`date +%m`
day=`date +%d`
mkdir -p $dir/$year/$mouth/$day
cd $logdir
mv access_log $dir/$year/$mouth/$day/access_log.old
mv error_log $dir/$year/$mouth/$day/error_log.old
/usr/local/apache/bin/apachectl graceful
sleep 20
cd $dir/$year/$mouth/$day && gzip access_log.old  error_log.old
echo "successful"
 

作者: 非洲乌龟   发布时间: 2010-12-02