nginx 访问日志和错误日志按日切割sh脚本

mkdir -p ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/
mv  ${source_path}logs.log ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/i-access_$(date -d "yesterday" +"%Y%m%d").log
mv  ${source_path}error.log ${logs_path}$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m")/i-error_$(date -d "yesterday" +"%Y%m%d").log
kill -HUP `cat /usr/local/nginx/var/nginx.pid`


你可能感兴趣的:(nginx,脚本)