User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 397,719 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,573 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 1386 | Replies: 6
Reply
Join Date: Oct 2006
Posts: 13
Reputation: madankumar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
madankumar madankumar is offline Offline
Newbie Poster

Automating sftp (script) to copy files

  #1  
Jul 11th, 2008


Hi can nayone help me to write SFTP script to copy files from one server to another sever


any help appreciated


Thank you
Madan
Madan Kumar T
Bangalore.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2006
Posts: 13
Reputation: madankumar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
madankumar madankumar is offline Offline
Newbie Poster

Re: Automating sftp (script) to copy files

  #2  
Jul 11th, 2008
Hi can nayone help me to write SFTP script to copy files from one server to another sever not ftp script


any help appreciated


Thank you
Madan
Reply With Quote  
Join Date: Oct 2007
Posts: 266
Reputation: eggi is on a distinguished road 
Rep Power: 1
Solved Threads: 26
eggi eggi is offline Offline
Posting Whiz in Training

Re: Automating sftp (script) to copy files

  #3  
Jul 12th, 2008
Hey There,

How's the script as it stands? Basically you just need to loop around the scp command (highly depends on how that looping construct is executed, based on what you're looking to do)

scp file1 host1:/some/dir/.

Is the basic syntax to scp the file from the server you're on to the remote - to do it the other way, from the server you're on

scp host1:/some/dir/file1 .

optionally, for the remote host, instead of just the hostname

host1

you might need to attach the copy to a specific user like this:

user1@host

Hope that helps

, Mike
Linux and Unix Tips, Tricks and Individual Advice - The Linux and Unix Menagerie!
------------------------------------------------------------------------
Having trouble passing cert exams? Check out How To Pass Any Computer Certification Test!
Reply With Quote  
Join Date: Jul 2008
Posts: 8
Reputation: myle is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
myle myle is offline Offline
Newbie Poster

Re: Automating sftp (script) to copy files

  #4  
Jul 13th, 2008
It helps if you have already upload your public ssh-rsa key to the remote machine. Then you don't have to enter the password each time the scp is executed.
Reply With Quote  
Join Date: Oct 2006
Posts: 13
Reputation: madankumar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
madankumar madankumar is offline Offline
Newbie Poster

Re: Automating sftp (script) to copy files

  #5  
Jul 14th, 2008
Originally Posted by myle View Post
It helps if you have already upload your public ssh-rsa key to the remote machine. Then you don't have to enter the password each time the scp is executed.


Hi Thanks for reply ..

I am new to the scripting ... also this concept could you please give the some detail explanation on this , so it may be helpful.

Thanks in Advance
Madan
Madan Kumar T
Bangalore.
Reply With Quote  
Join Date: Jul 2008
Posts: 8
Reputation: myle is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
myle myle is offline Offline
Newbie Poster

Re: Automating sftp (script) to copy files

  #6  
Jul 14th, 2008
generate ssh keys:
http://www.daniweb.com/forums/thread130410.html

I think eggi has posted all the information you need.
Reply With Quote  
Join Date: Oct 2006
Posts: 13
Reputation: madankumar is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
madankumar madankumar is offline Offline
Newbie Poster

Re: Automating sftp (script) to copy files

  #7  
Jul 14th, 2008
Thanks for you help

Incase any info required will be intouch you

Thank you
Madan Kumar T
Bangalore.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Shell Scripting Marketplace
Thread Tools Display Modes

Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 2:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC