11

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?

Phrogz
  • 543
  • 7
  • 18

1 Answers1

18

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

faker
  • 17,496
  • 2
  • 60
  • 70