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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.