Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 11 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 '14 at 15:24

Your Answer


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.