can we have a quiet news.daily?
Florian Schlichting
fschlich at CIS.FU-Berlin.DE
Thu Nov 5 09:30:08 UTC 2009
Hi,
I'd prefer my Daily Usenet report to be quiet, only emailing me if
there's something I need to attend to. Documentation for the 'nomail'
keyword to news.daily suggests that this should be possible: "...all
utilities ... have their stdout and stderr redirected into a file. If
the file is empty, no message is sent." Alas, even when not generating a
text report, innreport will always print a heading with the date,
scanlogs will add a few separating lines, and news.daily adds yet
another newline.
What I'd like to suggest is making innreport's heading depend on the
value of {default}{text} (as set in innreport.conf), have scanlogs look
for innreport output before printing the separators, and move the
news.daily newline to scanlogs.
what do you think?
Florian
--- a/scripts/innreport.in
+++ b/scripts/innreport.in
@@ -2073,7 +2073,8 @@ sub Write_all_results {
$Title =~ s/\&/&/go;
$Title =~ s/\</</go;
$Title =~ s/\>/>/go;
- print "$Title from $first_date to $last_date\n\n";
+ print "$Title from $first_date to $last_date\n\n"
+ if $$h{'default'}{'text'} =~ m/^true$/i;
}
if ($HTML) {
--- a/scripts/news.daily.in
+++ b/scripts/news.daily.in
@@ -279,7 +279,6 @@ if [ -n "${PROGRAMS}" ] ; then
fi
${DOLOGS} && {
- echo ''
scanlogs ${SCANARG}
}
--- a/scripts/scanlogs.in
+++ b/scripts/scanlogs.in
@@ -238,12 +238,17 @@ OLD_LOG=${OLD}/${BASE}.0
## and summarize syslog information.
BASE=`basename ${SYSLOG_NOTICE}`
OLD_SYSLOG=${OLD}/${BASE}.0
+INNREPORT=${TMPDIR}/innreport$$
if [ -s ${OLD_SYSLOG} -o -s ${OLD_LOG} ] ; then
- ${PATHBIN}/innreport -f ${PATHETC}/innreport.conf ${OLD_SYSLOG} ${OLD_LOG}
- echo ---------
- echo ''
+ ${PATHBIN}/innreport -f ${PATHETC}/innreport.conf ${OLD_SYSLOG} ${OLD_LOG} > ${INNREPORT}
+ if [ -s ${INNREPORT} ] ; then
+ echo ''
+ cat ${INNREPORT}
+ echo ---------
+ echo ''
+ fi
fi
-rm -f ${OLD_LOG} ${OLD_SYSLOG}
+rm -f ${OLD_LOG} ${OLD_SYSLOG} ${INNREPORT}
OLD_SYSLOG=${OLD}/${EXPLOG}.0
rm -f ${EXPLOG}
More information about the inn-workers
mailing list