nginx日志分割

A 1-post collection
6 年前

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

nginx日志分割  

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