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 ]
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.
Filters out well-known lines from cronjobs and emails. If there are no others, you will not be bothered.
If one line does not fit you get the whole message, so you get the whole context.
The (first) supicious line(s) get(s) marked.
Presets exist for mysql-zrm, mysqloptimize, rsnapshot, rsync, rsnapshot-backup, spamassassin, webalizer, sophos, ntpdate, darbackup, kprop (kerberos replication), exim (targeting debian bug report #818349) and bacula.
-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)
/some perl compatible regex/ => number or 'u' for unlimited occurance
# comment
Empty lines are ignored.
Inside crontab use:
0 22 * * * root mysql-zrm 2>&1 | cron-silencer -f mysql-zrm
0 22 * * * root mysql-zrm 2>&1 | cron-silencer -f mysql-zrm -a /etc/cron-silencer.d/enhance-zrm.cnf
0 22 * * * root ownscript 2>&1 | cron-silencer -F /etc/cron-silencer.d/ownscript.cnf
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
crontab(1), crontab(5), cron(8), perlre(1), procmail(1), procmailrc(5), https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=818349
This manual page was written by LiHAS <support@lihas.de>
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.
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).