apache graceful重启
时间:2010-12-02 来源:非洲乌龟
#!/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"
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"
相关阅读 更多 +