Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Manually running logrotate -f /etc/logrotate.d/nginx will forcefully rotate the logs configured in that file.

share|improve this answer
    
Thank you, that did it. :) Will accept when allowed. –  Phrogz Mar 20 at 15:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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