Is there any other way to trigger log reopen beside kill -USR1?

Andre Jaenisch andrejaenisch at googlemail.com
Thu Jan 24 13:00:10 UTC 2013


2013/1/24 Liu Haifeng <haifeng.813 at gmail.com>:
> My goal is make the "current" log file renamed with the date pattern immediately, not after one day or other period.

My first thought would be creating a symbolic (see "man ln") from the
current log to the log-with-date-within-filename.
You would just have to change the symlink then … For example like
this: http://www.unix.com/302239409-post5.html
So let access.log point to access.$(date "+%Y%m%d").log (see
https://en.wikipedia.org/wiki/Date_%28Unix%29 ).

But I have no nginx running here at the moment.



More information about the nginx mailing list