
# /etc/Tpbackup shell script
# Copyright 1986 L/F Technologies, Carson City, Nevada
# Author: Rodger Lakey
# Date Dec 10, 1986
# Version 1.0
#
DEVICE=/dev/tape

echo "Tape Backup Program"
echo ""
echo "Enter filenames and/or directory names to be saved to tape."
echo "Names may be entered on one line separated by spaces,"
echo "or entered on separate lines. A blank line will terminate"
echo "the list. Then the files will be copied to tape."

LIST=""
set -f
while :
do
	echo "Enter names: \c"
	read NAME
	if [ "$NAME" = "" ]
	then
		break
	fi
	LIST="$LIST $NAME"
done

if [ "$LIST" = "" ]
then
	echo "No files have been requested. Exiting program."
	exit
fi

mt rewind
if find $LIST -print | cpio -ov | wbuf $DEVICE
then
	echo "Backup done, rewinding tape."
else
	echo ""
	echo "An error has occurred while copying the requested"
	echo "files to tape. The backup on the tape may not be good."
	echo "Please either try the backup again, or verify"
	echo "that the tape is good by running the Tplist program."
fi
set +f
mt rewind
