April 16, 2017 · Logrotate Server

Setup Logrotate

/etc/crontab

25 6    * * *   root    logrotate -vf /etc/logrotate.conf

/etc/logrotate.conf

# system-specific logs may be configured here
/var/www/logs/*.access.log {
        daily
                missingok
                rotate 60
                compress
                notifempty
                dateext
                dateformat -rotated-%Y-%m-%d-%s
                postrotate
                service nginx reload
                endscript
}
# see "man logrotate" for details