🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.mail.misc
Article #4782

Re: Automatic Updating of pathalias database

#4782
From: David S. Hayes
Date: Mon, 16 May 1988 23:45
66 lines
2300 bytes
     I use this script from my crontab to update my maps.  (Note
that I have some things in non-standard places.)  This system does
keep both the news articles and the unpacked maps around, but I
don't regard that as a problem.  I run expire several times each
night (I know, get C news expire), and comp.mail.maps gets cleaned
out when it reaches 3 days old.

     The "make install" at the end runs pathalias, and formats the
results for smail.  I haven't had to touch my mail maps for about
6 months.  Have fun,

     	  David Hayes


#!/bin/sh
# This script will extract the new maps received in comp.mail.maps.
# It uses the file "Last_Maps_Extracted" to keep track of when it
# last updated the maps.  All articles in comp.mail.maps newer than
# that file are unshar-ed.
#
# If no files were produced by the unshar, then we quit.
# If there were files, we mail "news" a report of what was received.
# Then we move those maps to our path map directories MAP_U and
# MAP_D.  Finally, we build and install a new path file.

PATH=/usr/local/bin:/bin:/usr/bin

MAPNEWS=/usr/spool/news/comp/mail/maps
MAPTMP=/usr/tmp/getmaps
MAP_U=/usr/spool/uucp/map/u
MAP_D=/usr/spool/uucp/map/d

test -d $MAPTMP || mkdir $MAPTMP
rm -f $MAPTMP/*

NEWER=
if [ -f Last_Maps_Extracted ]; then
  NEWER="-newer Last_Maps_Extracted"
fi
FILES=`find $MAPNEWS -type f $NEWER -print`
for FILE in $FILES ; do
  ( cd $MAPTMP ; unshar $FILE )
done

NEWMAPS="`ls $MAPTMP`"
if [ "$NEWMAPS" = "" ]; then
  exit 0;
fi

( echo "The following maps were received:"
  ls -C $MAPTMP ) \
| /usr/ucb/mail -s "Usenet Maps Received" news

mv -f $MAPTMP/u.* $MAP_U
mv -f $MAPTMP/d.* $MAP_D
rmdir $MAPTMP

date > Last_Maps_Extracted

make install
exit 0

-- 
David S. Hayes, The Merlin of Avalon	PhoneNet:  (202) 694-6900
UUCP:  *!uunet!cos!hqda-ai!merlin	ARPA:  merlin@hqda-ai.arpa
Technical Details
Message-ID: <3691@hqda-ai.ARPA>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cos!hqda-ai!merlin
References: <284@trwrc.RC.TRW.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cos!hqda-ai!merlin
From: merlin@hqda-ai.ARPA (David S. Hayes)
Newsgroups: comp.mail.misc
Subject: Re: Automatic Updating of pathalias database
Keywords: pathalias
Message-ID: <3691@hqda-ai.ARPA>
Date: 16 May 88 23:45:50 GMT
References: <284@trwrc.RC.TRW.COM>
Reply-To: merlin@hqda-ai.ARPA (David S. Hayes)
Organization: Army AI Center, Pentagon
Lines: 66