How to make the log file printed by access_log split

Richard Kearsley rkearsley at
Thu Jul 25 09:39:28 UTC 2013

There's no size limit, it will keep getting bigger until your disk is full
Here's a script I use to rotate the log, run it from cron every hour
hope it helps

PID=`cat /usr/local/nginx/logs/`
NOW=$(date +"%Y-%m-%d-%H-%M")
mv ${LOG} ${NEWLOG}
kill -USR1 ${PID}
gzip ${NEWLOG}

On 25/07/13 09:52, shawnxzhou wrote:
> what's the limit of the size of log file, and what will happen when it
> reaches the limitation?
> if I want to split the log file by timeline, say start a new file on the
> beginning of an hour, how can I configure ngnix?
> thanks
> Posted at Nginx Forum:,241226,241226#msg-241226
> _______________________________________________
> nginx mailing list
> nginx at

More information about the nginx mailing list