标签:usr AC nginx日志切割 日志 style /usr ESS nginx日志 amp
#!/bin/bash #nginx日志切割脚本 [ $UID !=0 ] && { echo "Please run as root" exit 1 } logs_path="/usr/local/nginx/logs/" mkdir -p ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/ mv ${logs_path}access.log ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/access_$(date -d "yesterday" +"%Y%m%d").log kill -USR1 `cat /usr/local/nginx/logs/nginx.pid
标签:usr AC nginx日志切割 日志 style /usr ESS nginx日志 amp
原文地址:https://www.cnblogs.com/Template/p/9076408.html