Rename log file based on its content

Francis Daly francis at
Wed May 3 20:29:09 UTC 2017

On Tue, May 02, 2017 at 02:37:30PM +0200, SARA QUISPE MEJIA wrote:

Hi there,

> I want to know How can I do for to rename a log file in function to the
> date of my log file ?
> I known that in a log file I could find differents dates but I want to save
> just the first date.

It is probably easiest to do this outside of nginx.

Rename ("mv") your log file to whatever name you want, then send a
USR1 signal to the nginx process.

Francis Daly        francis at

More information about the nginx mailing list