Command Line Tape Utility

MT COMMAND:
$ mt -f /dev/rmt/0cbn rewind Rewind tape drive
$ mt -f /dev/rmt/0cbn status Display status information about the tape unit
$ mt -f /dev/rmt/0cbn erase Erase the tape
$ mt -f /dev/rmt/0cbn bsf 1 Goto previous record
$ mt -f /dev/rmt/0cbn fsf 1 Forward record
$ mt -f /dev/rmt/0cbn eod Go to end of data
$ mt -f /dev/rmt/0cbn offline Unload tape
$ mt -f /dev/rmt/0cbn tell Find out what block you are at with mt command
$ mt -f /dev/rmt/0cbn retension Check retention
——-

TAR COMMAND:
$tar cvf /dev/rmt/0cbn / backup the entire system to tape
$tar cvzf /dev/rmt/0cbn /bin only backup the /bin directory to tape and compress
$tar tvf /dev/rmt/0cbn view the contents of a tape
$tar xvf /dev/rmt/0cbn restore the entire contents of the tape
$tar xvf /dev/rmt/0cbn /etc/sendmail.cf only restore the file ’/etc/sendmail.cf’ from tape
$tar xvzf /dev/rmt/0cbn /bin restore and uncompress the directory /bin from tape

# tar -czf /dev/rmt/0cbn /www /home Backup directory /www and /home with tar command (z – compressed)

TAR Option:
c create a archive (write to tape)
t display files on archive (view only)
x extract from archive (read from tape and write to disk)
v verbose – display filenames
z compress files (using gzip)
f device name or file name to write to