LR_CRON(1)

NAME
lr_cron - run periodical Lire jobs

SYNOPSIS
lr_cron period

DESCRIPTION
lr_cron is designed to be called in a crontab(1) entry. period should be "daily" or "weekly".

lr_config(1) can be run to configure lr_cron. However, since lr_cron's configuration files are in simple shell syntax, configuration can be build manually too. We describe the configuration here.

The program sources sysconfdir/lire/defaults, and expects this file to set variables lr_jobfiles_daily and lr_jobfiles_weekly. These variables are expected to hold lists of files, e.g.

 lr_jobfiles_daily="${prefix}/etc/lire/email/daily.qmail \
   ${prefix}/etc/lire/email/daily.sendmail"
These files are sourced. They should set environment variable log to one or more logfiles, filter to a filter command to preprocess the log, superservice and service to the (super)service this logfile belongs to, flags to flags, to pass to lr_log2mail(1) for this logfile, to to the address, lr_log2mail(1) should sent the email to, and subject to the subject this program should use. As you could've guessed by now, lr_cron(1) runs lr_log2mail(1) for each file in lr_jobfiles_period.

A file in a jobfiles list could look like e.g.

 log=/var/log/mail.log.0
 filter="lr_run lr_desyslog qmail"
 subject="`hostname` `date +%Y%m%d`"
 superservice=email
 service=qmail
 to=postmaster
 flags=
.

lr_log2mail(1) is called as

 lr_run $filter < $log | \
   lr_run lr_log2mail -s "$subject" $service $to $flags
.

This could expand to e.g.

 lr_run lr_desyslog qmail < /var/log/mail.log.0  | \
   lr_run lr_log2mail -s "host.domain.com 20010310" \
   qmail postmaster
or

 lr_run gzip -dc < /var/log/apache/combined.log.1.gz | \
   lr_run lr_log2mail -s subject combined postmaster@domain.com,root
Note: in case lr_jobfiles_period is not set, lr_cron(1) exits silently and successfully.

SEE ALSO
lr_log2mail(1), lr_run(1), lr_config(1)

VERSION
This manpage: $Id: lr_cron.pod,v 1.7 2002/08/18 19:29:51 vanbaal Exp $

COPYRIGHT
Copyright (C) 2000-2001 Stichting LogReport Foundation LogReport@LogReport.org

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html or write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.

AUTHOR
Joost van Baal <joostvb@logreport.org>