Operating System - HP-UX
1834285 Members
3286 Online
110066 Solutions
New Discussion

Re: How to check if a tape is inserted

 
Mason Liu
Advisor

How to check if a tape is inserted

Is there a simple way to tell whether a tape is in the drive? Not sure if "mt status" can do this.

Also, fbackup allows me to notify a user when it's done. Can I attach a file with that notification msg? If not, I have to sendmail.

Thanks.
4 REPLIES 4
MAD_2
Super Advisor

Re: How to check if a tape is inserted

You may do it as described below, but first you must know your device location (name), it will be something like /dev/rmt/0m, or /dev/rmt/1m (normally 0m if you only have one tape drive). To check the status do this:

mt -t status
i.e.:
mt -t /dev/rmt/0m status
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
MAD_2
Super Advisor

Re: How to check if a tape is inserted

You may also write a small script that will notify users of the tape status, let's say if you are running a special backup and want someone to be notified if the backup fails due to tape problems, see attachment.
Contrary to popular belief, Unix is user friendly. It's just very particular about who it makes friends with
Corthouts Carlo
Valued Contributor

Re: How to check if a tape is inserted

Hi,

The best way to check this is with :

mt -t status (10.20)
mt -f status (11.00)
Mason Liu
Advisor

Re: How to check if a tape is inserted

I will try Mynor's script. This is a Oracle online backup script I was writing on HP-UX 11.00. If the tape is not ready, I don't want the script to mess up with the tablespaces.

I did a "mt offl" at the end of the script to eject the tape. This check can be useful if someone forgets to change tape.

Thanks.