Operating System - HP-UX
1830864 Members
2439 Online
110017 Solutions
New Discussion

what is the advantage of the cpio command

 
Nabil Boussetta
Frequent Advisor

what is the advantage of the cpio command

i usually use tar and cp commands. i'd like to khnow what should be the advantages of the cpio command comparing to theses commands
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: what is the advantage of the cpio command

cpio has a different option set which may meet your needs better than tar.

I've not found the need to go beyond tar except when working with oracle web distributions that require me to unpack files from cpio cd images.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: what is the advantage of the cpio command

Originally cpio was hailed as the "new" replacement for tar but that was decades ago. Cpio can be more selective than tar and also the -p option is very useful for copying directory trees to another location.
Both tar (at least the vanilla versions) and cpio are limited to 2GB files so always keep that limitation in mind.
If it ain't broke, I can fix that.
Nick W
Frequent Advisor

Re: what is the advantage of the cpio command

Nabil,

cpio is very portable between different OS flavours (just like tar). It is due to this portability - conformance to (POSIX?) industry standards and interoperability goals - that also constrain it (eg support for large files and large UIDs....)

There is also pax (man pax for details) which can read and write both cpio and tar archives, as well as its own native format. I believe this has the same portability constraints as tar and cpio....

If you need to copy largefiles (>2GB) consider (GNU) tar or backup commands eg fbackup/frecover (for example, to copy files from /source to /target:

cd /source ; fbackup -f - -i . | (cd /target; frecover -rXf -)


HTH

Regards,
Nick
** PS please do not forget to assign any points - (you have assigned points to 0 of 8 responses)

Re: what is the advantage of the cpio command

Read somewhere that CPIO can handle data errors (skip the file), whereas TAR will terminate if it encounters a problem.
Also see:
http://www.linuxjournal.com/article.php?sid=1213

Ted
Cem Tugrul
Esteemed Contributor

Re: what is the advantage of the cpio command

Hi Nebil,
As an adition please have look at;
http://docs.hp.com/en/B2355-90672/index.html
especially chapter9
Table 9-2, â A Comparison of Backup/Recovery Utilitiesâ

good
Our greatest duty in this life is to help others. And please, if you can't
Cem Tugrul
Esteemed Contributor

Re: what is the advantage of the cpio command

oppss...

http://docs.hp.com/en/B2355-90672/ch09s05.html
Our greatest duty in this life is to help others. And please, if you can't