Nginx日志切割脚本

#!/bin/bash
date=`(date +"%Y-%m-%d" --date="-1 day")`
date1=`(date +"%Y-%m-%d" --date="-7 day")`
for i in `ls /data/wwwlogs/|grep -Ev "old_log|phpdebuginfo"`;
do
mv /data/wwwlogs/$i /data/wwwlogs/old_log/$i-$date
done
rm -rf /data/wwwlogs/old_log/*-$date1
/usr/sbin/nginx -t && /usr/sbin/nginx -s reload