System Administration Guide, Volume I

How to Copy Files to a Tape (tar)

  1. Change to the directory that contains the files you want to copy.

  2. Insert a write-enabled tape into the tape drive.

  3. Copy the files to tape with the tar command.


    $ tar cvf /dev/rmt/n filename  ...

    c

    Indicates you want to create an archive. 

    v

    Displays the name of each file as it is archived. 

    f /dev/rmt/n

    Indicates that the archive should be written to the specified device or file. 

    filename ...

    Indicates the files and directories you want to copy. 

    The file names you specify are copied to the tape, overwriting any existing files on the tape.

  4. Remove the tape from the drive and write the names of the files on the tape label.

  5. Verify that the files copied are on the tape using the tar command with the t option, which displays the tape's contents. See "How to List the Files on a Tape (tar)" for more information on listing files on a tar tape.


    $ tar tvf /dev/rmt/n
    

Example--Copying Files to a Tape (tar)

The following example copies three files to the tape in tape drive 0.


$ cd /export/home/kryten
$ ls reports
reportA reportB reportC
$ tar cvf /dev/rmt/0 reports
a reports/ 0 tape blocks
a reports/reportA 2 tape blocks
a reports/reportB 5 tape blocks
a reports/reportC 6 tape blocks
$ tar tvf /dev/rmt/n