#!/bin/sh
#
# mkvbscript
#
# mhpower, 24 August 1992
#
# When given a sipb.mit.edu AFS server name as its only argument, this script
# generates another script to run "vos backup" on all the appropriate volumes
# on this server. Only RW volumes are selected, and names beginning with
# "disk." or ending with ".nb" are excluded. The name of the output script
# is /usr/tmp/vb-script.S.T where S is the server name and T is today's date
# in the format DDMonYYYY.
#
#
if [ $# -ne 1 ]; then
    echo "usage: mkvbscript AFS_server_name" 1>&2
    exit 1
fi
PATH=/bin:/usr/ucb:/usr/bin:/afs/sipb/project/gnu/bin:/afs/athena/system/afsuser/@sys/bin; export PATH
SFILE=/usr/tmp/vb-script.$1.`date | awk '{print $3 $2 $6}'`
rm -f $SFILE
echo '#!/bin/sh' > $SFILE
vos listvol -server $1 -cell sipb.mit.edu -noauth | ggrep On-line | ggrep ' RW ' | ggrep -v '\.nb ' | gegrep -v '^disk\.' | awk '{printf("/afs/athena/system/afsuser/@sys/bin/vos backup -id %s -cell sipb.mit.edu -verbose\n", $1)}' >> $SFILE
chmod 755 $SFILE
