shell脚本
#!/bin/bash
LOGPATH=/data/wwwlogs/access.log
BASEPATH=/applogs/$(date -d +%Y%m)
mkdir -p $BASEPATH
bak=$BASEPATH/$(date +%Y%m%d).access.log
mv $LOGPATH $bak
touch $LOGPATH
kill -USR1 `cat /var/run/nginx.pid`
定时任务
*/1 * * * * sh /data/runlog.sh