python safe scripting

Vladimir Rusinov vladimir at greenmice.info
Thu Nov 22 04:50:58 EST 2007


On 11/21/07, Guilherme Polo <ggpolo at gmail.com> wrote:
>
> 2007/11/21, Vladimir Rusinov <vladimir at greenmice.info>:
> > Hello!
> >
> > In one my project (it's logfile manager) I want to implement 'smart'
> > configuration files, e.g.
> >
> > logfile("/var/log/messages")
> > if (size() > 10*1024*1024) and (lavg() < 5):
> >     execute("my_log_alerter")
> >    rotate(save=10, compress='bzip2')
> >
> > how can I safely do this?
> >
> logging already provides the rotating
>

Yes, but apache, nginx and others does not uses logger.
I wanna write an application which would handle all my (Linux) logs:
rotating, compressing, analysing and so on (logrotate replacement), it would
require some nontrivial configuration, something like "If size of this log
bigger then 2Mb or today is sunday. If size of this log bigger then 30 Mb,
and today is not sunday, then rotate it, and make alert".
Is there any module to parse such configuration files?

-- 
Vladimir Rusinov
GreenMice Solutions: IT-решения на базе Linux
http://greenmice.info/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071122/4c4db122/attachment.html>


More information about the Python-list mailing list