Operating System - HP-UX
1752795 Members
6174 Online
108789 Solutions
New Discussion юеВ

Copying files by using SCP in a Script

 
SOLVED
Go to solution
Virumandi
Frequent Advisor

Copying files by using SCP in a Script

HI ,

I want to copy files from one of my server to other by using scp.

I am using a script which will generate a tar file and I want it to paste it automatically to my other server using SCP.

But how can I can make this automation in a Script.

I dont want it to ask for the password while copying to the server.

Can anybody guide me...

Thanks & Regards
Suseendran. A
4 REPLIES 4
Joel Girot
Trusted Contributor
Solution

Re: Copying files by using SCP in a Script

Hi,

this short tutorial gives some ideas. I adapt it for a sftp transfer between hpux sh Shell and linux and I come back for publish the result.

http://blogs.translucentcode.org/mick/archives/000230.html

Regards

Joel
Yogeeraj_1
Honored Contributor

Re: Copying files by using SCP in a Script

hi Suseendran,


SCP uses ssh for data transfer, and uses the same authentication and provides the same security as ssh. Hence, you should configure ssh such that your remote connection are establish without it asking for "the password". if this works, the scp command in the script will work too!

kind reagrds
yogeeraj

No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Joel Girot
Trusted Contributor

Re: Copying files by using SCP in a Script

I attach a document found on this forum which appears useful. (previously posted by Steven E Protter).

Joel
Raj D.
Honored Contributor

Re: Copying files by using SCP in a Script

Virumdandi,

You have to setup dsa id on that server by using sshkeygen command , and then it will not ask for password either for ssh or scp.
Once it has been done the task is easy , write a script to generate the source file and scp it over to your target server.

let me know if you need more info,

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "