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 sizbut 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
May 9, 2002
269
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
 
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