Force log rotation immediately
rotate log now | run logrotate manually | rotate log file immediately | logrotate force | logrotate | disk-spaceCaution: This command changes the system. Understand what it does before you run it.
logrotate -vf /etc/logrotate.d/nginx-f forces the rotation regardless of the conditions in the configuration, and -v shows each step. Useful for testing a new configuration for real or for shrinking an oversized log right away. This also runs the postrotate scripts, which usually reload a service.
Note: Depending on the rotate value, the oldest rotated file is dropped. Check beforehand with logrotate -d what would happen.
Also searched as
- rotate log now
- run logrotate manually
- rotate log file immediately
- logrotate force