Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to chech if a tape is loaded into drive? 2

Status
Not open for further replies.

trifo

MIS
Joined
May 9, 2002
Messages
269
Location
HU
Hi!

I am trying to detect if the tape is present in the drive or not. It would be necessary for a backup script. On solaris "mt status" command gives this information, but in AIX it does not. What else does?

--Trifo
 
Normally I would just :

dd if=/dev/rmt0 of=/dev/null bs=512 count=1

and check the exit code - 1 or 0.

"Long live king Moshiach !"
 
tctl rewind /dev/rmt0 2> /dev/null
if [ $? = 0 ];then
echo "MAG TAPE IS PRESENT"
else
echo "NO MAG TAPE IN TAPE DRIVE"
fi
 
How about using tapechk, just try to check consistency on first file.It would normal rewind and the read the files(tapechk 1 to check the first file on the tape). Just capture the exitcode thats it.

ravi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top