How to do it...

We are going to look at an example configuration.

We have two options for managing log files:

  1. Create a new configuration file and store it in /etc/logrotate.d/. This configuration file will be executed daily along with other standard jobs. This will be with root privileges.
  2. Create a new configuration file and execute it independently. This will execute with non-root privileges. This way, you can execute it manually, at whatever times you want.

Get Bash Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.