![]() Create a script outside Logrotate’s installation directory to run Logrotate for you.īut for this example, you’ll create a custom config file in the /etc/logrotate.d directory.Ĭreating Logrotate rules in the /etc/logrotate.d directory rotates your logs only daily, weekly, and monthly by default.ġ.Add a config file to the / etc/logrotate.d directory.There are two ways to create custom Logrotate rules: You can set up your own rules to rotate your logs the way you want. ![]() One of the great things about Logrotate is that it is customizable. Previewing the logrotate man page Setting up Custom Rules to Rotate Logs ![]() Run the cat command below to view the contents of Logrorate’s configuration file for the apt package ( /etc/logrotate.d/apt). Take a look at the Logrotate configuration file for the apt package so that you can understand the parameters in more detail. You can use these example config files as a starting point for creating your own log rotation rules.
0 Comments
Leave a Reply. |