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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make dd command wait until a tape loads via autoloader

Status
Not open for further replies.

WiccaChic

Technical User
Jan 21, 2004
179
US
Hey all. Just got a 3490E tape drive and it has a 7 tape autoloader that I need to use. The scenario is, I will load 6 tapes (not a set, 6 seperate pieces of datum)and que up 6 jobs to run back to back to restore the file(s) from each tape. My problem is, when the first job ends and unloaded the tape, the next job on the que fires up before the autoloader has a chance to unload the previous tape and load the next tape...how do I make my jobs, which are simple dd commands, wait until the tape drive is ready?

I grew up in an AS400 shop and this process was transparent operationally on that server, so I was surprized to run up against this in AIX.
 
if you want to set a specific delay, just use the "sleep" command.

I'm going to assume you're using Atape as the driver, but since your drive is not in random mode, you can't query it with "tapeutil", so really I think you're limited to "sleep"
 
Add a monitor function in your backup script to check if the dd is still running for that pid every couple seconds if it is not, then sleep until it is unloaded.
 
Hi,
I do this )in sh or ksh scripts) so:

for i in 1 2 3 4 5 6
do
............................
while [[ "mt -f /dev/rmt0 fsf 0 2>&1|cut -f 2 -d /" = "dev" ]]
do
:
done # device is not ready
.............................
dd if=/dev/rmt0 of=YourFile bs=<blocksize>
.............................
done

Regards Boris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top