<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body>
<span id="mailbox-conversation">Thanks for the reply. I compiled nginx from source, 1.7.5. I'm on Ubuntu 14.04. I know there's a log rotation function built-in but I prefer to work things out by myself. :D<div>So I created this script to automatically rotate my logs:<div>
<div style="color: rgba(0, 0, 0, 0.701961); font-family: UICTFontTextStyleBody; font-size: 17px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-composition-fill-color: rgba(130, 98, 83, 0.0980392); text-decoration: -webkit-letterpress;">find /var/www/ -ipath */logs/access.log.gz -execdir mv "{}" "old/`date +\%G-\%m-\%d`-access.log.gz" \;</div>
<div style="color: rgba(0, 0, 0, 0.701961); font-family: UICTFontTextStyleBody; font-size: 17px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-composition-fill-color: rgba(130, 98, 83, 0.0980392); text-decoration: -webkit-letterpress;">wait</div>
<div style="color: rgba(0, 0, 0, 0.701961); font-family: UICTFontTextStyleBody; font-size: 17px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-composition-fill-color: rgba(130, 98, 83, 0.0980392); text-decoration: -webkit-letterpress;">/opt/nginx/sbin/nginx -s reopen</div>
</div>
<div style="color: rgba(0, 0, 0, 0.701961); font-family: UICTFontTextStyleBody; font-size: 17px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-composition-fill-color: rgba(130, 98, 83, 0.0980392); text-decoration: -webkit-letterpress;"><br></div>
<div style="color: rgba(0, 0, 0, 0.701961); font-family: UICTFontTextStyleBody; font-size: 17px; -webkit-tap-highlight-color: rgba(26, 26, 26, 0.301961); -webkit-composition-fill-color: rgba(130, 98, 83, 0.0980392); text-decoration: -webkit-letterpress;">Maybe the problem is that logs get reopen before files are moved? But "wait" should deal with that..</div>
</div></span><div class="mailbox_signature"><br></div>
</body></html>