SCP File Transfer

On unix AIX server, when I am trying to transfer file from one directory to another directory on the same server through a program(where i call the script) it gives error "Lost Connection".

For copy the files inside the same server, we dont need scp at all.

cp -f source target

scp is used to transfer files from one server to another server.
Cheers,
Ranga:-)

I agree with you Ranga...that CP command can be used...

But am executing my script( having scp command) through a program (ABAP code), also same script is used for transferring file to other server.

Also one thing when i manually execute SCP command, am able to transfer file within the server....

Before SCP, we were using RCP command which was working fine...i.e
transferring within server and transferring to other server successfully

Hence thought SCP should work in same fashion

I've only seen one implementation of scp which does, and it takes its time doing do.

I too reccomend using cp instead of scp when appropriate.

Alright, make sure below things are properly used,

  1. Give full path to scp like /bin/scp
  2. Check source file variables that contains full path in it.
  3. Check host name or ip used correctly with required credentials.
  4. Try to redirect the stderr of scp command to your err file that will give you some idea.
    Cheers,
    Ranga:-)

You should check the path and directories when you transfer files and make sure that they are correct. ABAP programs gives code to transfer the file and as you say that SCP also work in the same fashion. Just check it and definitely you will be able to transfer the file through it.

----------------------------------
Different sap solution