I have two questions related to developing configuration files for the logrotate tool on Linux systems.
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?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
- 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.
- 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.