Previous | Table of Contents | Next |
Follow these steps to retrieve files from a tape:
In this example, all files are copied from the tape in drive 0:
oak% cd /home/winsor/Evaluations oak% tar xvf /dev/rmt/Ø x evaluation.doc, 44Ø32 bytes, 86 tape blocks x evaluation.doc.backup, 43ØØ8 bytes, 84 tape blocks oak%
To retrieve individual files from a tape, type tar xvf /dev/rmt/n filename filename filename ... and press Return. The file names you specify are extracted from the tape and placed in the current working directory. In this example, files with the prefix evaluation are copied from the tape in drive 0:
oak% cd /home/winsor/Evaluations oak% tar xvf /dev/rmt/0 evaluation* x evaluation.doc, 44032 bytes, 86 tape blocks x evaluation.doc.backup, 43008 bytes, 84 tape blocks oak%
Follow these steps to retrieve directories and subdirectories recursively from a tape:
NOTE: The names of the files extracted from the tape exactly match the names of the files stored on the archive. If you have any doubts about the names or paths of the files, first list the files on the tape. See "Listing the Files on a Tape (tar)" earlier for instructions and the tar(1) manual page for more information.
The cpio command copies files, special files (files used to represent peripheral devices attached to a system), and file systems that require multiple tape volumes, and provides compatibility for copying files from SunOS 5.x systems to SunOS 4.x systems. Advantages of using the cpio command are that it packs data onto tape more efficiently than the tar command, skips over any bad spots in a tape when restoring files, provides options for writing files with different header formats (tar, ustar, crc, odc, bar) for portability between different system types, and creates multiple tape volumes.
When you use the cpio command to create an archive, it takes a list of files or path names from standard input and writes to standard output. The output is almost always redirected to a file or device. The following sections describe how to use the cpio command to copy files to a cartridge tape, list the files, retrieve all files, and retrieve a subset of the files from a cartridge tape.
Follow these steps to copy all files in a directory to a tape:
In this example, all the files in the directory /home/winsor/TOI are copied to the tape in tape drive 0:
oak% cd /home/winsor/TOI oak% ls | cpio -oc > /dev/rmt/Ø 31 blocks oak%
To list files on a tape:
NOTE: Listing the table of contents takes as long as it does to read the archive file because the cpio command must process the entire archive.
In this example, the table of contents for the tape in drive 0 contains four files:
oak% cpio -civt < /dev/rmt/Ø 1ØØ666 winsor 3895 Feb 24 15:13:Ø2 1992 Boot.chapter 1ØØ666 winsor 3895 Feb 24 15:13:23 1992 Directory.chapter 1ØØ666 winsor 6491 Feb 24 15:13:52 1992 Install.chapter 1ØØ666 winsor 1299 Feb 24 15:14:ØØ 1992 Intro.chapter 31 blocks oak%
The first column shows permissions in octal form; the second column shows the owner of the file; the third column displays the number of characters (bytes) in the file; the fourth, fifth, sixth, and seventh columns show the month, date, time, and year the file was last modified; and the final column shows the name of the file.
Previous | Table of Contents | Next |