The logrotate command

rotates, compresses, and mails system logs 2 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.

Options in the examples

-d, --debug
Turn on debug mode, which means that no changes are made to the logs and the logrotate state file is not updated.
-f, --force
Tells logrotate to force the rotation, even if it doesn't think this is necessary.

Examples

sudo logrotate -d /etc/logrotate.d/myapp
sudo logrotate -f /etc/logrotate.d/myapp

Lessons that use logrotate