为了方便查看php错误日志信息,将php的日志按照时间进行分割,器脚本如下
phpPid='/usr/local/webserver/php-5.3.27/var/run/php-fpm.pid'
phplogs='/data0/log-data'
savelog='/home/service/logs'
top=$savelog/$(date +%Y)/$(date +%m)
mkdir -p $top/php
if [ -f $phplogs/php_error.log ]; then
mv $phplogs/php_error.log $top/php/errors.$(date +%Y%m%d).log
fi
echo `cat $phpPid`
kill -USR1 `cat $phpPid`
chmod -R 777 $top