From Wiki-UX.info

Wiki-UX / Backup Commands / How to use cpio
Jump to: navigation, search

How to use cpio

Abstract

This article is a quick reference on the usage of the cpio command on the HP-UX Operating Environment. A review of the current HP-UX Reference Mainpages is highly advisable for additional examples, syntax description and relevant warnings or notifications.

Contents


Name

cpio - copy file archives in and out; duplicate directory trees

Synopsis

cpio -o [-e extarg ] [achvxABC]
 
cpio -i[bcdfmrstuvxBPRSU6] [pattern...]
 
cpio -p [-e extarg ] [adlmruvxU] directory
NOTE: The cpio command reads the list of files that will be added to the archive directly from the standard input instead that as expression in the command itself. In this differs from the other backup commands (fbackup, pax, tar). It is a common practice to pipe a find command output with cpio to feed the required file list.


Writing archive

# cd /
 
# find ./tmp | cpio -ov > /var/tmp/archive.cpio
tmp
tmp/lost+found
tmp/.AgentSockets
Socket <tmp/.AgentSockets/A> not backed up
tmp/printer
tmp/printer/net_ljM9040MFP.sh
tmp/install.vars
tmp/X11_newfonts.log
tmp/kminstall-lock.
tmp/sd_ipd_acl.1701
tmp/services
tmp/runner_configure.txt
tmp/prngd.log
tmp/V2C-RUN_config.log
tmp/dtappint.log
Socket <tmp/mysql.sock> not backed up
tmp/rpcbind.file
tmp/llbdbase.dat
tmp/portmap.file
tmp/dhcpfifo.root
tmp/mana28722
tmp/char
tmp/mana17685
tmp/mana03221
tmp/PHCO_35998
tmp/PHCO_35998.text
tmp/PHCO_35998.depot
tmp/ACL.log
tmp/1111io_listener.log
tmp/dhcpfifo.any
tmp/.VRTSisisshmem
tmp/dprado
tmp/dprado/test
tmp/dprado/test2
tmp/dprado/test3
tmp/dprado/test4
tmp/PMS_July08
tmp/PMS_July08/psi_separate.pl
tmp/PMS_July08/PSIFILE.tar.gz
tmp/lvmtab
tmp/mana28104
tmp/SystemInfo.jets.txt
tmp/AllInfo.jets.txt
1846 blocks
jets: / # file /var/tmp/archive.cpio
/var/tmp/archive.cpio:  cpio archive

Listing archive

#

Extracting archive

# 

Copying Files

 

Extracting archives to relative directories

Reference

  • HP-UX Reference - cpio (1) - HP-UX 11i Version 3: February 2007
This page was last modified on 18 April 2011, at 22:36. This page has been accessed 2,941 times.