Help: Script to detect the tape
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
Hi informix ppl, We are planning to cron a script to back-up our informix database at level 0. But our script is not bulletproof, e.g it can't detect if there is a tape loaded in the drive. If anyone have a script to share, it will be great helpful. Thankz in advance. Kind Regards, ph4gl -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
You need to give the details of system and tape. usually there is a Unix mt command that lets you get state of the tape. mt -f tapedevice status man mt. check return codes from the mt commands. but there are specialized tape control utilities for robots and multi-tape hardware. -- --------------------------------------------------------- Steven Hauser email: hause011@tc.umn.edu URL: http://www.tc.umn.edu/~hause011 ---------------------------------------------------------
In article <7e1llu$lt9$1@nnrp1.dejanews.com>, ph4gl@hotmail.com wrote: > > > Hi informix ppl, > > We are planning to cron a script to back-up our informix > database at level 0. But our script is not bulletproof, e.g > it can't detect if there is a tape loaded in the drive. > If anyone have a script to share, it will be great helpful. > Thankz in advance. > > Kind Regards, > ph4gl You should be able to check the output of "mt -t /dev/rmt/? rew". If the output is null, your tape exists. Something like this should work (at least under HPUX 10.20): -------------------------------------- #!/usr/bin/sh TAPE=/dev/rmt/0mb /usr/bin/mt -t $TAPE rew if [ $? != 0 ] then echo "No tape in ${TAPE}" fi -------------------------------------- Kevin -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own