cron-silencer

Name

cron-silencer -- A backend to cron job messages.

Synopsis

cron-silencer [ -A ] [-m [ -M ]] { -f mysql-zrm | mysqloptimize | spamassassin | webalizer | rsync-rsnapshot | rsnapshot-backup | sophos | ntpdate | darbackup | bacula | kprop | exim201603 } | -F file } [ -a file [-a file ...]] [ file ]

DESCRIPTION

This manual page documents the cron-silencer command.

cron-silencer is a program to easily filter messages from cron jobs. cron-silencer uses regular expressions to check if a given output line is pointless or maybe not.

The initial idea behind cron-silencer was to have more control over stupid cron job messages and system mails to keep your mailbox clean. Just pipe the output through cron-silencer to shut them up. cron-silencer filters out well-known lines and only if there are unknown ones (presumably errors) you get the full message with the incriminated line(s) marked.

FEATURES

OPTIONS

-f

Filter to use. Choose one of: mysql-zrm, mysqloptimize, rsync-rsnapshot, rsnapshot-backup, spamassassin, webalizer, sophos, ntpdate, darbackup, kprop (kerberos replication), exim (targeting debian bug report #818349) and bacula.

-F

File with filter lines to use. Needs a path name as parameter.

-a

File with additional filter lines to use. Needs a path name as parameter. Has to be combined with -F or -f. May be given multiple times. For identical patterns, rules superseed in order of appearance.

-A

Report all unrecognized lines, not only the first one.

-m

Input is an e-mail, skip until (and including) first empty line.

-M

Echo email headers on output. This might be useful for email pass-through filtering.

-h

Print out help.

-b

echo email body to output

-e

set errorcode to 1 if any errors were found (default: 0)

-s

prefix email-subject with '[cserr]' if any errors were found (default: no prefix)

FILTER FILE SYNTAX

ENVIRONMENT

None

Examples

Inside crontab use:

Inside ~/.procmailrc use:

    ## serv01.domain.de integrit logs 
    # f = filter whole mail
    # H = match header
    :0 fH
    * ^Subject: \[integrit\] serv01.domain.de
    |cron-silencer -s -A -m -M -b -F ~/.cron-silencer/integrit -a ~/.cron-silencer/integrit-local
		  

Filter file rule:

		  	# accept all SUCCESS and INFO messages:
		  	/SUCCESS|INFO/ => u
		  	# accept up to 3 of these messages:
		  	/^Warning: waiting for lock$/ => 3
		  

FILES

/etc/cron-silencer.d recommended directory for pattern files.

SEE ALSO

crontab(1), crontab(5), cron(8), perlre(1), procmail(1), procmailrc(5), https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818349

BUGS

Fixes a problem caused somewhere else.

AUTHOR

This manual page was written by LiHAS for the cron-silencer software and may be used by others. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.

DISTRIBUTION

The newest version of cron-silencer can be obtained from http://ftp.lihas.de/debian

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; Version 2. This guarantees your right to use, modify, and redistribute cron-silencer under certain conditions.

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 (it is in the COPYING file of the cron-silencer distribution).