[comp.unix.questions] Getting status of a tape drive

jepeway@UTKCS2.CS.UTK.EDU (Chris Jepeway) (07/27/87)

'lo,
    I'm writing a c-shell script to do backups on our system, a VAX 8200
running Ultrix 1.2.  I'd like to be able to determine whether there is a
tape mounted and online in the tape drive (a TU81 plus), and I want to be
able to do so regardless of whether some other process is using the drive.
Using `mt status' and then checking the status c-shell variable, or parsing
mt's output, has proven unreliable: mt will often say that there's 
`No such device or address: /dev/rmt12' when, in fact, there's a tape in the
drive and the sucker's online.  I'd prefer to use a standard Unix/Ultrix
program that's out there already, but I can flex to a home grown c program
if need be.  Any help would be greatly appreciated.  I mean greatly.

Thanks Ever,
C. Jepeway

ldm@homxc.UUCP (L.MARCO) (07/30/87)

In article <8500@brl-adm.ARPA>, jepeway@UTKCS2.CS.UTK.EDU writes:
> 
>     I'm writing a c-shell script to do backups on our system, a VAX 8200
> running Ultrix 1.2.  I'd like to be able to determine whether there is a
> tape mounted and online in the tape drive (a TU81 plus), and I want to be
> able to do so regardless of whether some other process is using the drive.

	Why not the csh equivalent of:

if echo >/dev/rmt0
then
:
else
echo Rmt0 is fubar
exit
fi

Disclaimer : I use old fashioned Bourne shell exclusively.
Flames on "Don't you know that won't work in csh' >/dev/null