使用 reopen 参数重新打开日志文件

This commit is contained in:
zjcqoo 2019-05-28 16:11:34 +08:00
parent 14fcdf1a21
commit 43f5a9db6b

View File

@ -28,11 +28,10 @@ logfile=$SVC_DIR/log-svc/backup/$logtime.log
#
# 先移走日志文件,然后创建新的日志文件,通知 nginx 重新打开
# https://www.nginx.com/resources/wiki/start/topics/examples/logrotation/
#
mv $LOG_FILE $logfile
touch $LOG_FILE
kill -USR1 $(< $LOG_DIR/nginx.pid)
$SVC_DIR/run.sh reopen
sleep 1
#