1834811 Members
2811 Online
110070 Solutions
New Discussion

CPIO from Linux to HP-UX

 
yc_2
Regular Advisor

CPIO from Linux to HP-UX

Hi,

I use the following to copy files from Linux (RedHat 9) to HP-UX 11i but to no avail:

cd /sourcedir
find . -xdev | cpio -coa | ssh -l "cd ; cpio -icdmul"

Password:
Out of phase--get help
Perhaps the "-c" option should be used

Not success even -c is taken.

Thanks in advance.
3 REPLIES 3
Peter Godron
Honored Contributor

Re: CPIO from Linux to HP-UX

Hi,
from man cpio:
"cpio -i could not read the header of an archived file. The
header is corrupt or it was written in a different format.
Without the R option, cpio returns an exit code of 2.

If no file name has been displayed yet, the problem may be the
format. Try specifying a different header format option: null
for standard format; c for ASCII; b, s, P, or S, for one of the
byte-swapping formats; or 6 for UNIX Sixth Edition.
Otherwise, a header may be corrupt. Use the R option to have
cpio attempt to resynchronize the file automatically.
Resynchronizing means that cpio tries to find the next good
header in the archive file and continues processing from there.
If cpio tries to resynchronize from being out of phase, it
returns an exit code of 1."

So I would first try the -r option.
Secondly I would split the command into
1. Create cpio file
2. Transfer
3. Extract cpio
This would help pinpoint the problem.

Please update with results.
Ninad_1
Honored Contributor

Re: CPIO from Linux to HP-UX

Hi,

Dont know for sure, but I suspect that since you are asked for a password by the remote system and then you proceed with entering the password - the cpio archive you are piping to the other server thru ssh is getting corrupted in between.
Can you try the same with a user for which you may have set remote login without requiring a password. e.g
Suppose user1 (say root) can remote execute commands on the remote server, login on the source server as user1 (say root) and then execute
find . -xdev | cpio -coa | ssh "cd ; cpio -icdmul"

Regards,
Ninad
yc_2
Regular Advisor

Re: CPIO from Linux to HP-UX

Hi,

I used a work around solution ie: scp -r to copy.

Thanks.