System Administration Guide: Basic Administration

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.


    $ tar cvf /dev/rmt/n filenames
    

    c

    Indicates that 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. 

    filenames

    Indicates the files and directories that you want to copy. Separate multiple files with spaces. 

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

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

  5. Verify that the files you copied are on the tape.


    $ tar tvf /dev/rmt/n
    

    For more information on listing files on a tar tape, see How to List the Files on a Tape (tar).

Example—Copying Files to a Tape (tar)

The following example shows how to copy 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 59 tape blocks
a reports/reportB 61 tape blocks
a reports/reportC 63 tape blocks
$ tar tvf /dev/rmt/0