sftp automation for downloading files
Hi,
I want to use sftp in order to download some files from a remote server. My case is the following: 1. username: user123 2. pass: pass123 3. remote server: ftp.myserver.com The commands I want to send after the connection are: 1. bin 2. cd mydir 3. get myfile I want to write a script to automate this procedure using cron. Any help regarding the sftp command line abilities would be appreciated. Thanks :) |
consider using scp.
e.g. scp user@remotehost:/mydir/filename . with the use of publickeys, you can avoid keying in passwords. |
thanks for your reply.
I did not know how to use the public key, however this site http://bumblebee.lcs.mit.edu/ssh2/ was very helpful. :D |
Another question.
if my connection is broken do u know if my copy can be resumed? |
Hi,
1st method: you can run ftp with an automated script command execution after connection.. ftp -s:"<your_script.txt>" ftp.myserver.com The content of your_script.txt could simply be: user123 pass123 bin cd mydir get myfile by 2nt method: type in command line the following: ftp ftp://user123:pass123@ftp.myserver.com:21/mydir/myfile Hope this helps, bye Kess |
Sorry, The smile is a :p
Bye.. |
All times are GMT -5. The time now is 09:03 PM. |