1753758 Members
4722 Online
108799 Solutions
New Discussion юеВ

cpio

 
Prashanth Waugh
Esteemed Contributor

cpio

Hi,

After running the cpio command , we are checking echo $? its shwoing 0 but it has some entries in the output file where we are redirecting standard error.(Example:
current newer)

why its recording some entries eventhough its showing successful (0)

Regards,
Prashant
For success, attitude is equally as important as ability
3 REPLIES 3
R.O.
Esteemed Contributor

Re: cpio

Hi,

This is because it is a warning, not an error and command completes succesfully. From "man cpio":

"If cpio -i tries to create a file that already exists and the existing file is the same age or newer, cpio will output a warning message and not replace the file. The -u option can be used to unconditionally overwrite the existing file"

Regards,
"When you look into an abyss, the abyss also looks into you"
Dennis Handly
Acclaimed Contributor

Re: cpio

You can also use pax(1) to read cpio files:
pax -r -f foo.cpio ...
Michael Steele_2
Honored Contributor

Re: cpio

Hi

I don't see your procedure. Here is what I have.

cd /dir
find . | cpio -oBx > /dev/rmt/0m (* write out to tape *)

cpio -itB < /dev/rmt/0m (* read table of contents and verify tape *)

cpio -idumvB "pattern in dir Path file format" < /dev/rmt/0mn 2> /error_file (* selective restore of one file, log errors to /error_file *)
Support Fatherhood - Stop Family Law