Is it possible to run one logrotate check manually?

Viewed 560703

Is it possible to run one iteration of logrotate manually without scheduling it on some interval?

8 Answers

Yes: logrotate --force $CONFIG_FILE

Edit /var/lib/logrotate.status (or /var/lib/loglogrotate/logrotate.status) to reset the 'last rotated' date on the log file you want to test.

Then run logrotate YOUR_CONFIG_FILE.

Or you can use the --force flag, but editing logrotate.status gives you more precision over what does and doesn't get rotated.

Related