1825508 Members
1644 Online
109681 Solutions
New Discussion юеВ

rcp exit codes

 
SOLVED
Go to solution
Mike Ingram_1
Frequent Advisor

rcp exit codes

hi All,

I have a script that rcp's files to another server, and I am checking if the return code is 0 or not, to determine success.
I am getting a few failures, and would like to know what the problem is, so thought I'd expand the script and have different messages for different return codes.

Can anyone tell me what non-zero return codes I could expect and what they mean?
So far, all I have found is that a non-zero return code is a failure!

Thanks.
3 REPLIES 3
Rajeev  Shukla
Honored Contributor
Solution

Re: rcp exit codes

You would have only 2 return codes
0=success
1=failure
Bill Hassell
Honored Contributor

Re: rcp exit codes

The problem (like return codes for remsh) is that the return code does NOT verify the success of a file transfer! It only signals whether a connection was made succesfully. So an error will be returned if the hostname is not found or the host refuses the connection. Otherwise, rcp is always successful.

Now when you look at all the possibilites for file transfer problems, you can understand that a single error code is not appropriate. For instance, you rcp a directory and half the files fail to transfer because the target location is full. Would the error code be 0.50? Or what do you return if some of the source files are not readable? and so on..

SO you have to process the text returned by rcp, or better yet, run remsh to look in the target directory to see if all is well.


Bill Hassell, sysadmin
Mike Ingram_1
Frequent Advisor

Re: rcp exit codes

Thanks guys.

I suspected as much, although it's not was I was hoping to hear!

Cheers.