[net.sources] lbgm logfile validate routine

barto@celerity.UUCP (David Barto) (12/19/84)

cat > INTRO <'EOF'
This routine will check the contents of the logfile for the lbgm
archive against the contents of the directory.  It reports any
mis-matches.

	This ends with an 'exit' so you can feed it directly to sh.

EOF
cat > lbgm.validate <<'EOF'
#! /bin/sh
ARCHIVE=${LBGMDIR:-/usr/lbgm}
LOGFILE=save.sog
LS=/tmp/ls$$
MISSING=$ARCHIVE/Missing

trap "/bin/rm $LS $MISSING" 1 2 3 9

cd $ARCHIVE

: 'get the list of files'
/bin/ls *_* | grep -v '#' > $LS
: 'get the files from the logfile.'
awk '/^Jan_|^Feb_|^Mar_|^Apr_|^May_|^Jun_|^Jul_|^Aug_|^Sep_|^Oct_|^Nov_|^Dec_/' $LOGFILE | sort | sed -e 's/://' | diff - $LS > $MISSING

if [ -s $MISSING ]
then
	echo "The following files are NOT in the log"
	grep -v '>' $MISSING | sed -e 's/>//' | more
	echo "The following files do NOT have source associated"
	grep -v '<' $MISSING | sed -e 's/<//' | more
else
	echo "No missing files"
fi
/bin/rm -f $LS $MISSING
EOF
exit
-- 
David Barto		      akgua!celerity!barto
{decvax || ucbvax || ihnp4}!sdcsvax!celerity!barto
"If you are using more than 7 sites to get here, you are taking the long way"