Do note that the example they use shows /var/log/news/*, so I'm pretty sure /var/log/news/ will not do anything for you. As I've noted in another thread, you can run logrotate with the '-d' flag and it will not perform any rotations, but will show you what it WOULD do for a particular configuration file.
can a logrotate config point to a directory
-
30-06-2022 - |
Question
Primary question: Is it a valid option in a logrotate config to have the targeted log be a directory?
I have seen several examples using the wildcard notation of /var/log/example/*.log
, but I am curious if the option of /var/log/example
will give a similar result.
I checked the man pages, but only found examples with the wildcard syntax. This led me to believe that was the only way. However, there is a sentence in the doc which reads, "The last section defines the parameters for all of the files in /var/log/news" in reference to an example without a wildcard, which caused me to question.
Background of question:
In dealing with the logrotate recipe (from the apache2 community cookbook) which is intended to setup logrotation for the httpd install, the created config points to a directory. logrotate -d
shows that an operation is being performed (I think), but none of the files contained in the directory are being rotated on logrotate -f
. Since obviously I am unfamiliar with logrotate I was hoping someone could enlighten me (before I log a ticket / pull request).
Solution