Nginx Log Rotation Quick Question

Ok so I am using Logrotate to take care of my Nginx logs in my users individual web site directories. See below:

/home/*/logs/*.log {
    daily
    missingok
    rotate 3
    compress
    delaycompress
    notifempty
    sharedscripts
    prerotate
        if [ -d /etc/logrotate.d/httpd-prerotate ]; then \
        run-parts /etc/logrotate.d/httpd-prerotate; \
    fi; \
    endscript
    postrotate
    [ ! -f /var/run/nginx.pid ] || kill -USR1 `cat /var/run/nginx.pid`
    endscript
}

This is basically a replica of the nginx logrotate script that is already in /etc/logrotate.d

I guess my question is. Is this the best way to accomplish this. What are you guys doing?

0 Replies

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct