Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!mnetor!uunet!hi-csc!giebelhaus
From: giebelhaus@hi-csc.UUCP (Timothy R. Giebelhaus)
Newsgroups: comp.unix.questions
Subject: Re: UUCICO exit status...
Message-ID: <38c135f3.4580@hi-csc.UUCP>
Date: Sat, 28-Nov-87 19:06:00 EST
Article-I.D.: hi-csc.38c135f3.4580
Posted: Sat Nov 28 19:06:00 1987
Date-Received: Tue, 1-Dec-87 01:41:05 EST
References: <134@csd_v.UUCP>
Organization: Honeywell CSDD, Golden Valley, MN
Lines: 44
Keywords: uucp, uucico
Summary: A script which works for me.

I use this script.  It works very well for me.  It also calls again if
the call was not finished (failed a normal termination).  One day I
plan to change it just a bit so that if it does turn out the call is
already in progress when the script starts, it checks to see if the
call terminated normally.  Now, if the call was already made by the 
remote host or uu.hourly, it just drops through.

#! /bin/sh
#
# Call uunet for news
newssystem=uunet
uucico -r1 -s${newssystem}
#
# Try to call again a few more times if I have to
# sleep first to be sure the STST and LCK files are stable.
sleep 60
ststfile=/usr/spool/uucp/STST.${newssystem}
lckfile=/usr/spool/uucp/LCK..${newssystem}
maxtries=aaaaaaaaaaaaaaaa
tries=a
while test -f $ststfile -a $tries != $maxtries -a ! -f $lckfile
	do
	echo "Failed, STST = `cat $ststfile`; tries = $tries" | mail root
	sleep 900
	tries=${tries}a
	rm $ststfile
	uucico -r1 -s${newssystem}
	sleep 60
	done
# Notify me if the news did not finish
if test $tries = $maxtries
	then
	echo "Failed to call $newssystem for news" | mail root
	fi
# Notify me if the news was already running.
if test -f $lckfile
	then
	echo "LCK file exists.  STST = `cat $ststfile`" | mail root
	fi
-- 
---------------------------------
UUCP: {uunet, ihnp4!umn-cs}!hi-csc!giebelhaus
ARPA: hi-csc!giebelhaus@umn-cs.arpa
Nobody I know admits to sharing my opinions.  I don't even have a pet.