nginx 日志切割脚本
#!/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