Skip to content

Commit

Permalink
使用 reopen 参数重新打开日志文件
Browse files Browse the repository at this point in the history
  • Loading branch information
EtherDream committed May 28, 2019
1 parent 14fcdf1 commit 43f5a9d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions log-svc/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

#
Expand Down

0 comments on commit 43f5a9d

Please sign in to comment.