logrotate

guide and functions

file example

/var/log/example.log {
        weekly
        size 500M
        missingok
        rotate 5
        compress
        copytruncate
        notifempty
}

test using debug mode

logrotate -d /etc/logrotate.d/example

run manually

logrotate -f /etc/logrotate.d/example