diff options
Diffstat (limited to '')
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | contrib/mmdsr | 25 |
2 files changed, 26 insertions, 3 deletions
@@ -153,6 +153,10 @@ Internationalization moving the entry aside and logging the fact after the third dequeue of the same entry. + Miscellaneous + + - Brad Knowles' mailman daily status report script updated to 0.0.17. + 2.1.9 (12-Sep-2006) Security diff --git a/contrib/mmdsr b/contrib/mmdsr index 25c52e0f..a19257b4 100644 --- a/contrib/mmdsr +++ b/contrib/mmdsr @@ -149,6 +149,11 @@ # Updated on: Sun Jan 29 11:45:58 CET 2006 # Mark found a couple of typos that I somehow let slip # through. Thanks! +# +# 0.0.17 Update by Mark Sapiro <mark@msapiro.net> +# Updated on: Thu Jan 3 18:25:06 PST 2008 +# Enabled processing the prior generation of a rotated log. +# Added SORT_FIELD to the user modifiable parameters. ############################################################################### # Set up locations of standard commands, directories, etc.... @@ -225,6 +230,12 @@ SUM_LOGS="fromusenet post smtp" SUBDIRS="archive bounces commands in news out retry shunt virgin" ############################################################################### +# Specify the field specifier used by your sort command to select the second +# field. This will normally be "+1" or "-k 2". +############################################################################### +SORT_FIELD="+1" + +############################################################################### # Specify recipients for report. If none, then simply print to "STDOUT". # Specify sender address for report. Not used if recipient list is empty. ############################################################################### @@ -304,7 +315,11 @@ do echo "==============================" >> $TMP if [ -f "$LOGDIR/${LOG}" ] ; then - $SED -e :a -e '$!N;s/\n //;ta' -e 'P;D' $LOGDIR/$LOG | $GREP -si "^$DAY [0-9][0-9:]* $YEAR" >> $TMPLOG + if [ -f "$LOGDIR/${LOG}.1" ] ; then + $SED -e :a -e '$!N;s/\n //;ta' -e 'P;D' ${LOGDIR}/${LOG}.1 $LOGDIR/$LOG | $GREP -si "^$DAY [0-9][0-9:]* $YEAR" >> $TMPLOG + else + $SED -e :a -e '$!N;s/\n //;ta' -e 'P;D' $LOGDIR/$LOG | $GREP -si "^$DAY [0-9][0-9:]* $YEAR" >> $TMPLOG + fi if [ "${LOG}" = "post" ] ; then @@ -312,7 +327,7 @@ do echo "Hourly Summary of Posts" >> $TMP echo "-----------------------" >> $TMP - $SED -e 's/^[A-Z][a-z][a-z] *[0-9]* //' -e 's/:.*$//' $TMPLOG | $UNIQ -c | $SORT -n +1 | $AWK '{ printf( "%8d %02d:00-%02d:59\n", $1, $2, $2 ) }' >> $TMP + $SED -e 's/^[A-Z][a-z][a-z] *[0-9]* //' -e 's/:.*$//' $TMPLOG | $UNIQ -c | $SORT -n $SORT_FIELD | $AWK '{ printf( "%8d %02d:00-%02d:59\n", $1, $2, $2 ) }' >> $TMP echo "" >> $TMP echo "Post Count by List" >> $TMP @@ -372,9 +387,13 @@ do $TOUCH $TMPLOG echo "Log file: $LOG" >> $TMP echo "==============================" >> $TMP - $GREP -si "^$DAY [0-9][0-9:]* $YEAR" $LOGDIR/$LOG >> $TMPLOG if [ -f "$LOGDIR/${LOG}" ] ; then + if [ -f "$LOGDIR/${LOG}.1" ] ; then + $GREP -si "^$DAY [0-9][0-9:]* $YEAR" ${LOGDIR}/${LOG}.1 ${LOGDIR}/${LOG} | $SED "s/^[^:]*://" >> $TMPLOG + else + $GREP -si "^$DAY [0-9][0-9:]* $YEAR" ${LOGDIR}/${LOG} >> $TMPLOG + fi if [ "${LOG}" = "error" ] ; then |