nginx日志分割

A 1-post collection
3 年前

Nginx 日志按日期分割日志,并定期删除

nginx日志分割  

cut_nginx_logs.sh #!/bin/bash #0 0 * * * /bin/bash /root/scripts/cut_nginx_logs.sh logs_path="/data/logs/" cd $logs_path for i in *.log do logspath=$logs_path/$(date "+%Y%m")/$(date "+%d")…