Scripting to copy FTP files between servers
I'd like to know if there is an example of writing a script to copy files from one server to another using FTP?
|
Try using wget from the target server
http://www.editcorp.com/Personal/Lar...v1/wget_7.html |
Or use a here document:
Code:
ftp -ni ftp.address.or.ip << EOF 1> $HOME/ftp.log 2> $HOME/ftp.err Code:
( |
|
If you want to use colucix's script and avoid using the user and the password in your script you can use ~/.netrc to store your ftp users and passwords, and protect just that file from curious eyes. Its format is:
machine your.ftp.to.store login your_user password your_password By the way, lftp allows you to put all the info as parameters and not having to pipe results to it. It would be something like lftp [ftp|sftp|ftps]://your.ftp.machine -u your_user,your_pass 2>&1 > bla bla bla |
is it possible to just use scp with keys or are you married to ftp ?
|
All times are GMT -5. The time now is 03:39 AM. |