Rename log file based on its content

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Rename log file based on its content

SARA QUISPE MEJIA
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.


_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

Re: Rename log file based on its content

Francis Daly
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.

http://nginx.org/en/docs/control.html

        f
--
Francis Daly        [hidden email]
_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx