diff options
author | rea <rea@FreeBSD.org> | 2012-11-10 18:01:20 +0800 |
---|---|---|
committer | rea <rea@FreeBSD.org> | 2012-11-10 18:01:20 +0800 |
commit | 0ea241bd439478217cafbe35ccfbe5cca835a493 (patch) | |
tree | 571166db855c9d90729cb2022e4843e28eea615a /mail/exim | |
parent | a08b7eab64e4841d2015c11e3eab8a2a0ac75c2b (diff) | |
download | freebsd-ports-gnome-0ea241bd439478217cafbe35ccfbe5cca835a493.tar.gz freebsd-ports-gnome-0ea241bd439478217cafbe35ccfbe5cca835a493.tar.zst freebsd-ports-gnome-0ea241bd439478217cafbe35ccfbe5cca835a493.zip |
mail/exim: add exim_tidydb_filter for periodic tidydb job
It allows to filter/transform the output from the tidydb that is
sometimes large and not very much suitable for informational mails
from cron.
Feature safe: yes
Diffstat (limited to 'mail/exim')
-rw-r--r-- | mail/exim/files/150.exim-tidydb.sh | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mail/exim/files/150.exim-tidydb.sh b/mail/exim/files/150.exim-tidydb.sh index 7f6522b24a9e..95a49c088b4f 100644 --- a/mail/exim/files/150.exim-tidydb.sh +++ b/mail/exim/files/150.exim-tidydb.sh @@ -16,12 +16,13 @@ fi : ${exim_tidydb_enable="YES"} : ${exim_tidydb="%%PREFIX%%/sbin/exim_tidydb"} +# Set this to arbitrary shell command to filter +# the output from this periodic script, for example, +# exim_tidydb_filter="| tail -100". +: ${exim_tidydb_filter=""} : ${exim_dbdir="/var/spool/exim"} -case "$exim_tidydb_enable" in - [Yy][Ee][Ss]) - echo "" - echo "Tidying Exim hints databases:" +tidy () { for db in "$exim_dbdir"/db/*.lockfile; do [ "$db" = "$exim_dbdir/db/*.lockfile" ] && continue echo @@ -30,6 +31,13 @@ case "$exim_tidydb_enable" in "$exim_tidydb" "$exim_dbdir" "$db_name" fi done +} + +case "$exim_tidydb_enable" in + [Yy][Ee][Ss]) + echo "" + echo "Tidying Exim hints databases:" + eval tidy "$exim_tidydb_filter" rc=1;; *) rc=0;; |