Return to General UNIX Home Page.


Controlling a Tape Drive

by Jeff Hunter, Sr. Database Administrator

Controlling the Tape Drive

Rewind the tape
# mt -f /dev/rmt/0 rewind
Advance the tape to the 5th EOF marker on the tape without rewinding the tape
# mt -f /dev/rmt/0n fsf 5
Look at the current file on the tape without rewinding the tape
# tar tvf /dev/rmt/0n
Get current file from the tape without rewinding the tape
# tar xvf /dev/rmt/0n
Put all of the files in the current directory to the tape without rewinding the tape
# cd /u06/app/oradata/SIEBEL
# tar cvf /dev/rmt/0n *

Controlling the Tape Drive Remotely

NOTE: Make sure the remote machine has a valid entry in its .rhosts file.

From the TARGET machine (i.e. APPDEV):

# rsh sblprod dd if=/dev/rmt/0n ibs=64k | tar xvf -
# rsh sblprod mt -f /dev/rmt/0n fsf 5
# rsh sblprod mt -f /dev/rmt/0 rewind
# rsh sblprod tar tvf /dev/rmt/0n

While loop to Restore Files from Tape

  while (true)
  do
    rsh sblprod dd if=/dev/rmt/0n ibs=64k | tar xvf -
  done



Last modified on: Saturday, 18-Sep-2010 18:20:59 EDT
Page Count: 12362