I have an Ubuntu web server running Nginx. I had never configured logfile rotation and have just discovered some multi-gigabyte monolithic log files.
I have configured log rotation now per these tips. However, I'd rather not wait a week (my rotation period) before the rotation occurs.
Is there a way to force immediate rotation of either a specific file, or all files specified by the logrotate
configuration?
Manually running
logrotate -f /etc/logrotate.d/nginx
will forcefully rotate the logs configured in that file.