#!/bin/bash
log_dir="/home/wwwlogs"
time=`date +%Y%m%d`
mv ${log_dir}/access.log ${log_dir}/access_$time.log
kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
最后一句是 让nginx重新记录日志
#!/bin/bash
log_dir="/home/wwwlogs"
time=`date +%Y%m%d`
mv ${log_dir}/access.log ${log_dir}/access_$time.log
kill -USR1 `cat /usr/local/nginx/logs/nginx.pid`
最后一句是 让nginx重新记录日志