Log rotation with automatic *.log file discovery

up vote 0 down vote favorite

I am hosting several websites which each of run their own Python process and write *.log output files, but the directory structure is not standardized.

Example:

-rw-r--r-- 1 plone      plone      125M 2012-08-29 11:35 ./x/var/log/instance-Z2.log
-rw-r--r-- 1 plone      plone       19M 2012-08-29 00:07 ./zope2.9/y/log/event.log
-rw-r--r-- 1 plone      plone      188M 2012-08-13 00:09 ./zope2.9/y/log/Z2.log
-rw-r--r-- 1 plone      plone      137M 2010-11-16 09:41 ./zope2.9/y/log/event.log

I'd like to make log rotate autodiscovery these log files and run a log rotation on them, as opposite to manually type in every log file to logrotate conf.

  • Does any existing tools offer this kind of log file discovery and rotation capabilities, without manually specifying each file?

  • If not... then just write a shell script which generates the logrotate conf?

linux logrotate
share|improve this question
asked Aug 29 at 8:58
spacer
Mikko Ohtamaa
369111

82% accept rate
feedback

1 Answer

active oldest votes
up vote 0 down vote

Here is a simple Python script for performing auto-discovery and generating logrotate conf file:

  • opensourcehacker.com/2012/08/30/autodiscovering-log-files-for-logrotate/
share|improve this answer
answered Aug 30 at 8:01
spacer
Mikko Ohtamaa
369111
feedback

Your Answer

 
log in
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged linux logrotate or ask your own question.

gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.