The cpio command (copy in/out) copies a list of files between devices by taking a list of names from standard input and writing to standard output. It is a versatile command but requires you to redirect standard-in and standard-out. cpio can be used when the amount of data requires the use of more that one volume (tape cartridge).
Example 1:
The following example shows how to copy the files in your working directory called /work and all subdirectories to the first tape drive with the logical device name of /dev/rmt/0.
example# cd /work example# ls -R | cpio -ocB > /dev/rmt/0
Example 2:
The next example shows how to copy the files that are located on your tape back to your hard disk:
example# cd /work example# cpio -icdB < /dev/rmt/0
The o option (copy out) reads the standard input to obtain a list of path names and copies those files onto the standard output.
The i option (copy in) extracts files from the standard input.
The c option indicates that header information has been written in ASCII format for portability.
The d option indicates that as many directories as needed will be created.
The B option, which you must use whenever you copy files or files systems to and from a tape drive, indicates that the input has a blocking factor of 5120 bytes to the record.
You must use the same blocking factor when you retrieve or copy files from the tape to the hard disk as you did when you copied files from the hard disk to the tape. In such cases you must specify the B option.