understand it. And thank you.<br><br><div class="gmail_quote">2009/6/22 Igor Sysoev <span dir="ltr">&lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Mon, Jun 22, 2009 at 03:18:44PM +0800, Chieu wrote:<br>
<br>
&gt; hi,all<br>
&gt; I found the way of the log rotation is below. And during the period between<br>
&gt; &quot;mv&quot; and &quot;kill&quot;,  some logs will be lost because of the file doesn&#39;t exist<br>
&gt; any more.<br>
&gt; Is there any good ways?<br>
&gt;<br>
&gt; thanks<br>
&gt;<br>
</div>&gt; &lt;<a href="http://wiki.nginx.org/index.php?title=NginxLogRotation&amp;action=edit&amp;section=1" target="_blank">http://wiki.nginx.org/index.php?title=NginxLogRotation&amp;action=edit&amp;section=1</a>&gt;<br>

<div class="im">&gt;<br>
&gt; nginx will re-open it&#39;s logs in response to the USR1 signal.<br>
&gt;<br>
&gt; $ mv access.log access.log.0<br>
&gt; $ kill -USR1 &lt;code&gt;cat master.nginx.pid&lt;/code&gt;<br>
&gt; $ sleep 1<br>
&gt; $ gzip access.log.0    # do something with access.log.0<br>
<br>
</div>No, the data will not be lost. Until a worker process keeps a file open<br>
the worker is able to write to the file even the file was renamed or deleted.<br>
This is true for both Unix and Win32 (although in Win32 in you can not delete<br>
an open files, you can just to rename them).<br>
<font color="#888888"><br>
<br>
--<br>
Igor Sysoev<br>
<a href="http://sysoev.ru/en/" target="_blank">http://sysoev.ru/en/</a><br>
<br>
</font></blockquote></div><br>