sendinpaths patch
Kenichi Okada
okada at opaopa.org
Thu Jan 31 22:35:27 UTC 2002
Hi,
My ninpaths often fails bacause of "dump file format error".
This patch will check dump files before generating a report.
--
Kenichi Okada
mailto:okada at opaopa.org
--- sendinpaths.in-ORIG Fri Feb 1 07:24:13 2002
+++ sendinpaths.in Fri Feb 1 07:30:00 2002
@@ -10,18 +10,25 @@
ME=`${NEWSBIN}/innconfval pathhost`
report=30
keep=14
-TMP=tmp$$
+TMP=""
defaddr=pathsurvey at top1000.org
-trap "rm -f $TMP; trap 0; exit" 0 1 2 15
# Make report from (up to) $report days of dumps
-find . -name 'inpaths.*' ! -size 0 -mtime -$report -print |\
- sed 's/^/-u /' > $TMP
+LOGS=`find . -name 'inpaths.*' ! -size 0 -mtime -$report -print`
+
+# for check dumps
+for i in $LOGS
+do
+ ninpaths -u $i -r $ME > /dev/null 2>&1
+ if test $? -eq 0; then :
+ TMP="$TMP -u $i"
+ fi
+done
if [ "$1" = "-n" ] ; then
- ninpaths `cat $TMP` -r $ME
+ ninpaths $TMP -r $ME
else
- ninpaths `cat $TMP` -r $ME |\
+ ninpaths $TMP -r $ME |\
$MAILCMD -s "inpaths $ME" ${1:-$defaddr}
# remove dumps older than $keep days
find . -name 'inpaths.*' -mtime +$keep -exec rm '{}' \;
More information about the inn-patches
mailing list