|
|||
1. Managing Removable Media (Overview) 2. Managing Removable Media (Tasks) 3. Accessing Removable Media (Tasks) 4. Writing CDs and DVDs (Tasks) 5. Managing Devices (Overview/Tasks) 6. Dynamically Configuring Devices (Tasks) 7. Using USB Devices (Overview) 9. Using InfiniBand Devices (Overview/Tasks) 11. Administering Disks (Tasks) 12. SPARC: Adding a Disk (Tasks) 13. x86: Adding a Disk (Tasks) 14. Configuring Solaris iSCSI Targets and Initiators (Tasks) 15. Configuring and Managing the Solaris Internet Storage Name Service (iSNS) 16. The format Utility (Reference) 17. Managing File Systems (Overview) 18. Creating UFS, TMPFS, and LOFS File Systems (Tasks) 19. Mounting and Unmounting File Systems (Tasks) 20. Using The CacheFS File System (Tasks) 21. Configuring Additional Swap Space (Tasks) 22. Checking UFS File System Consistency (Tasks) 23. UFS File System (Reference) 24. Backing Up and Restoring File Systems (Overview) 25. Backing Up Files and File Systems (Tasks) 26. Using UFS Snapshots (Tasks) 27. Restoring Files and File Systems (Tasks) 28. UFS Backup and Restore Commands (Reference) 29. Copying UFS Files and File Systems (Tasks) Commands for Copying File Systems Copying File Systems Between Disks Copying Directories Between File Systems (cpio Command) How to Copy Directories Between File Systems (cpio) Copying Files and File Systems to Tape Copying Files to Tape (tar Command) How to Copy Files to a Tape (tar) How to List the Files on a Tape (tar) How to Retrieve Files From a Tape (tar) Copying Files to a Tape With the pax Command How to Copy Files to a Tape (pax) Copying Files to Tape With the cpio Command How to Copy All Files in a Directory to a Tape (cpio) How to List the Files on a Tape (cpio) Copying Files to a Remote Tape Device How to Copy Files to a Remote Tape Device (tar and dd) How to Extract Files From a Remote Tape Device Copying Files and File Systems to Diskette How to Copy Files to a Single Formatted Diskette (tar) How to List the Files on a Diskette (tar) How to Retrieve Files From a Diskette (tar) |
Copying Files to Tape With the cpio CommandHow to Copy All Files in a Directory to a Tape (cpio)
The following example shows how to copy all of the files in the /export/home/kryten directory to the tape in tape drive 0. $ cd /export/home/kryten $ ls | cpio -oc > /dev/rmt/0 16 blocks $ cpio -civt < /dev/rmt/0 -rw-r--r-- 1 root other 0 Jul 28 14:59 2004, filea -rw-r--r-- 1 root other 0 Jul 28 14:59 2004, fileb -rw-r--r-- 1 root other 0 Jul 28 14:59 2004, filec drwxr-xr-x 2 root other 0 Jul 28 14:59 2004, letters drwxr-xr-x 2 root other 0 Jul 28 15:00 2004, reports 16 blocks $ How to List the Files on a Tape (cpio)Note - Listing the table of contents on a tape takes a long time because the cpio command must process the entire archive. Example 29-9 Listing the Files on a Tape (cpio) The following example shows how to list the files on the tape in drive 0. $ cpio -civt < /dev/rmt/0 -rw-r--r-- 1 root other 0 Jul 28 14:59 2004, filea -rw-r--r-- 1 root other 0 Jul 28 14:59 2004, fileb -rw-r--r-- 1 root other 0 Jul 28 14:59 2004, filec drwxr-xr-x 2 root other 0 Jul 28 14:59 2004, letters drwxr-xr-x 2 root other 0 Jul 28 15:00 2004, reports 16 blocks $ How to Retrieve All Files From a Tape (cpio)If the archive was created using relative path names, the input files are built as a directory within the current directory when you retrieve the files. If, however, the archive was created with absolute path names, the same absolute paths are used to re-create the file on your system. Caution - The use of absolute path names can be dangerous because you might overwrite existing files on your system.
The following example shows how to retrieve all files from the tape in drive 0. $ cd /var/tmp cpio -icvd < /dev/rmt/0 answers sc.directives tests 8 blocks $ ls -l How to Retrieve Specific Files From a Tape (cpio)
The following example shows how to retrieve all files with the chapter suffix from the tape in drive 0. $ cd /home/smith/Book $ cpio -icv "*chapter" < /dev/rmt/0 Boot.chapter Directory.chapter Install.chapter Intro.chapter 31 blocks $ ls -l |
||
|