Skip to content
Advertisement

logrotate configuration file development and testing

I have two questions related to developing configuration files for the logrotate tool on Linux systems.

  1. When I make a change to a file in /etc/logrotate.d, do I need to somehow notify logrotate so that it will recognize and respond to the change? It seems to notice changes on its own, eventually, but when testing log rotation specifications it would be useful to force logrotate to react to a new configuration file, rather than waiting for it to next run. Is this possible?

  2. If there is a problem in my logrotate configuration file, are errors reported and if so where can I find them?

Also, if there are common development patterns and techniques to follow when developing logrotate configuration files, please share them. If it matters, I am using Ubuntu 10.04.

Advertisement

Answer

  1. since the files in /etc/logrotate.d are included in include /etc/logrotate.d

include /etc/logrotate.d

so it is automatically updated when you change/add files in tha directory.

logrotate -f /etc/logrotate.conf can let it run.

  1. usually after changing your configuration, you should run it manually once and it will tell you if there is any error. error should by default also go to syslog, normally.
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement