**分割NGINX LOG日志
#!/bin/bash
log_dir="/data1/logs/nginx"
time=`date +%Y%m%d`
mv ${log_dir}/access.log ${log_dir}/access.log.$time
kill -USR1 `cat /var/run/nginx.pid`
sleep 1
cd /data1/logs/nginx
tar czvf access.log.$time.tgz access.log.$time
rm -f access.log.$time
阅读(495) | 评论(0) | 转发(0) |