INN commit: branches/2.5/scripts (scanlogs.in)

INN Commit rra at isc.org
Sat Mar 21 14:53:14 UTC 2015


    Date: Saturday, March 21, 2015 @ 07:53:14
  Author: iulius
Revision: 9805

scanlogs:  Limit the number of lines to show from error log files

When lots of lines are present in error log files, they appear in the
news.daily verbatim, and the resulting email is so large it is bouncing.

Restrict the number of lines to 50 (the default value for unknown lines
from news.notice).  

Thanks to Jeffrey M. Vinocur for the bug report.

Modified:
  branches/2.5/scripts/scanlogs.in

-------------+
 scanlogs.in |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Modified: scanlogs.in
===================================================================
--- scanlogs.in	2015-03-21 14:52:42 UTC (rev 9804)
+++ scanlogs.in	2015-03-21 14:53:14 UTC (rev 9805)
@@ -19,6 +19,9 @@
 ##  If you want to archive the active file, enable this line.
 ACTIVEFILE=${ACTIVE}
 
+##  Maximum number of lines to show from error log files.
+MAXERRLINES=50
+
 ##  Where these programs, if used, write their logs.
 ##  We also have to find innfeed's log file.
 CONTROLBATCH=${MOST_LOGS}/controlbatch.log
@@ -262,7 +265,7 @@
 OLD_SYSLOG=${OLD}/${BASE}.0
 if [ -s ${OLD_SYSLOG} ] ; then
     echo Syslog critical messages:
-    cat ${OLD_SYSLOG}
+    cat ${OLD_SYSLOG} | head -n ${MAXERRLINES}
     echo ---------
     echo ''
 fi
@@ -273,7 +276,7 @@
 OLD_ERRLOG=${OLD}/${BASE}.0
 if [ -s ${OLD_ERRLOG} ] ; then
     echo Error log:
-    cat ${OLD_ERRLOG}
+    cat ${OLD_ERRLOG} | head -n ${MAXERRLINES}
     echo ---------
     echo ''
 fi



More information about the inn-committers mailing list