aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrea <rea@FreeBSD.org>2012-11-10 18:01:20 +0800
committerrea <rea@FreeBSD.org>2012-11-10 18:01:20 +0800
commit0ea241bd439478217cafbe35ccfbe5cca835a493 (patch)
tree571166db855c9d90729cb2022e4843e28eea615a
parenta08b7eab64e4841d2015c11e3eab8a2a0ac75c2b (diff)
downloadfreebsd-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
-rw-r--r--mail/exim/files/150.exim-tidydb.sh16
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;;