From 88ab8e913321ecff4b00c75669deb781082d6d15009b1dd74e41f2794e8ad4de Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sat, 3 Jun 2006 19:23:04 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/server:mail/exim?expand=0&rev=8 --- eximstats-html-update.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 eximstats-html-update.py diff --git a/eximstats-html-update.py b/eximstats-html-update.py new file mode 100644 index 0000000..b99dc2d --- /dev/null +++ b/eximstats-html-update.py @@ -0,0 +1,39 @@ +#!/usr/bin/python + +import os, os.path, glob + +outdir_base = '/srv/www/eximstats' + +def main(): + os.chdir('/var/log/exim') + reports = glob.glob('main.log-*.gz') + glob.glob('main.log-*.bz2') + + for report in reports: + (base, ext) = os.path.splitext(report) + daystr = base[-8:] + + outdir = os.path.join(outdir_base, daystr) + + if os.path.exists(outdir): + continue + print 'processing', daystr + os.mkdir(outdir) + + if ext == '.gz': + catprg = 'zcat' + elif ext == '.bz2': + catprg = 'bzcat' + + + + os.system('%s %s | eximstats -html -charts -chartdir %s > %s/index.html' \ + % (catprg, report, outdir, outdir)) + + + + + + +if __name__ == '__main__': + main() +