Insert a tape that is not write-protected into the tape drive.
Copy files to a tape using the ls and cpio commands.
$ ls | cpio -oc > /dev/rmt/n |
ls |
Provides the cpio command with a list of file names. |
cpio -oc |
Specifies that cpio should operate in copy-out mode (-o) and write header information in ASCII character format (-c). This ensures portability to other vendor systems. |
> /dev/rmt/n |
Specifies the output file. |
All of the files in the directory are copied to the tape in the drive you specify, overwriting any existing files on the tape. The total number of blocks copied is displayed.
Verify the files are copied to tape by using the following cpio command.
$ cpio -civt < /tmp/cpio.file |
Remove the tape from the drive and write the names of the files on the tape label.
In this example, all of the files in the directory /export/home/kryten are copied to the tape in tape drive 0.
$ cd /export/home/kryten $ ls | cpio -oc > /dev/rmt/0 8 blocks $ cpio -civt < /tmp/cpio.file drwxr-xr-x 2 kryten users 0 Oct 24 11:05 1996, letters drwxr-xr-x 2 kryten users 0 Oct 24 11:05 1996, memos drwxr-xr-x 2 kryten users 0 Nov 8 14:14 1996, reports 8 blocks $ |