lmb@vicom.com (Larry Blair) (07/02/89)
We have a number of leaf sites that take identical feeds from us. As a
result, we only create one batch and then send it to each of the leaves.
For C News, I created a new batch handler, which I called viauuxl.
The enclosed script uses uux -l so that only a single, multiply linked
copy of the batch is used. If your uux does not support -l, you'll need
to modify appropriately. Even if you don't have -l, the multicasting
method is a big win.
Also note that the script uses Mail -s. Change if you system doesn't
support Mail or -s.
#! /bin/sh
# Transmit batch to all the sites listed in $NEWSCTL/lbatchsites.
#
. ${NEWSCONFIG-/usr/lib/news/bin/config}
BATCHNAME=/usr/spool/uucp/newsbatchs/$1.`getdate now`
cat - > $BATCHNAME
if [ $? -ne 0 ]
then
Mail -s "Could not write $BATCHNAME" usenet << EOF
An attempt to save a leafbatch to $BATCHNAME failed.
Possible causes may be insuffucient space on the filesystem or improper
permissions. The batch was discarded.
EOF
rm -f $BATCHNAME
exit 1
fi
GRADE=-gz
for site in `cat $NEWSCTL/lbatchsites`
do
case $site in
-g*) GRADE=$site; continue;;
esac
uux -r -l -n $GRADE $site!rnews \< !$BATCHNAME
error=$?
if [ $? -ne 0 ]
then
Mail -s "Status $error on $BATCHNAME for $site" usenet << EOF
Uux Failed for $site. Leafbatch script continued for other hosts.
EOF
exit
fi
done
rm -f $BATCHNAME
exit 0
--
Larry Blair ames!vsi1!lmb lmb@vicom.comlmb@vicom.com (Larry Blair) (07/02/89)
Oops... I forgot to mention how to use the script. You create a phony entry in your sys file, using a name that doesn't match up with a real system. In the batchparms file, enter a line for the phony name that that uses viauuxl instead of viauux for its transport. Using several phony names, you can tune your batches by distribution (i.e. a different batch for comp, rec, etc.). -- Larry Blair ames!vsi1!lmb lmb@vicom.com