#!/bin/bash
logs_path="/usr/local/nginx-1.14.2/logs/any/"
pid_path="/usr/local/nginx-1.14.2/logs/nginx.pid"
mv ${logs_path}access.log ${logs_path}access_$(date -d "yesterday" +"%Y%m%d").log
kill -USR1 `cat ${pid_path}`
定时任务
]# crontab -l
# 日志脚本
#*/5 * * * * /bin/bash /script/deny_host.sh
标签:1.14,logs,割接,pid,Nginx,nginx,path,日志
From: https://www.cnblogs.com/liudianer/p/17115858.html