Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Feb 132010
 

How to check the logrotate status?

Answer:

To check the current logrotate status, e.g. which files are covered by logrotate, what are their last processed date etc.

You can check the /var/lib/logrotate/status file

# cat /var/lib/logrotate/status

"/var/log/apache2/access.log" 2008-12-7
"/var/log/apache2/error.log" 2009-1-25
"/var/log/apache2/other_vhosts_access.log" 2009-1-25
"/var/log/apt/term.log" 2010-2-1

...
Dec 312009
 

How to check the current logrotate status?

Answer:

logrotate will maintain a status file, normally at the location /var/lib/logrotate/status , you can view the content of this file to see the latest status of all log files managed by logrotate.

Example:

logrotate state -- version 2
"/var/log/apache2/access.log" 2008-12-7
"/var/log/apache2/error.log" 2009-1-25
...

Therefore, it is useful to verify if your desired log files are controlled by logrotate or not.