Previous | Table of Contents | Next |
If the archive was created using relative path names, the input files are built as a directory within the current directory. If, however, the archive was created with absolute path names, the same absolute paths are used to re-create the file.
CAUTION! Using absolute path names can be dangerous because you can overwrite the original files.
Follow these steps to retrieve all files from a tape:
All the files on the tape in the drive you specify are copied to the current directory.
In this example, all files are copied from the tape in drive 0:
oak% cpio -icv < /dev/rmt/Ø Boot.chapter Directory.chapter Install.chapter Intro.chapter 31 blocks oak%
You can retrieve a subset of the files from the archive by specifying a pattern to match using shell wildcard characters enclosed in quotation marks after the options:
In this example, all files that end in the suffix chapter are copied from the tape in drive 0:
oak% cd /home/winsor/Book oak% cpio -icv "*chapter" < /dev/rmt/Ø Boot.chapter Directory.chapter Install.chapter Intro.chapter 31 blocks oak%
See the cpio(1) manual page for more information.
The 2.5 release and later provide the pax command, which stands for portable archive interchange. The pax command provides better portability than the tar or cpio commands for POSIX-compliant systems. Use the pax command to copy files, special files, or file systems that require multiple tape volumes or when you want to copy files to and from POSIX-compliant systems. Disadvantages of the pax command are that it is not aware of file system boundaries and the full path name length cannot exceed 255 characters.
Follow these steps to use the pax command to copy all the files in the current directory to a tape:
In this example, all files are copied from the tape in drive 0:
castle% pax -w -f /dev/rmt/0 . castle% pax -l -f /dev/rmt/0 . ./addusr-1.rs ./addusr-2.rs ./at-addmn.rs ./at-base.rs ./at-menu.rs castle%
See the pax(1) manual page for more information.
NOTE: When you use the pax command to copy files to a single-volume tape, you can also list and retrieve files from that tape by using the tar command.
Follow these steps to use the pax command to copy all the files on a tape into the current directory:
In this example, all files are copied from the tape in drive 0:
castle% pax -r -f /dev/rmt/0 . pax: . :not owner castle% ls -l -rw-rw-rw- 1 winsor staff 245660 Sep 12 11:52 addusr-1.rs -rw-rw-rw- 1 winsor staff 245660 Sep 12 10:31 addusr-2.rs -rw-rw-rw- 1 winsor staff 181315 Sep 12 10:29 at-addmn.rs -rw-rw-rw- 1 winsor staff 181309 Sep 12 10:27 at-base.rs -rw-rw-rw- 1 winsor staff 181315 Sep 12 10:28 at-menu.rs castle%
Previous | Table of Contents | Next |