每日切一个日志
#!/bin/sh
LOG_PATH=/home/test/nginx/logs
NEW_LOG_PATH=/home/test/nginx/dayslog
NGING_PID=$(cat /home/test/nginx/logs/nginx.pid)
DATE=$(date -d "yesterday" +%Y%m%d)
mv $LOG_PATH/access.log $NEW_LOG_PATH/access_$(date +%Y%m%d).log
killall -s USR1 nginx
加入定时任务
0 0 * * * /bin/sh /home/bash/cat_nginx_log.sh