[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Automating ftp



>You can install ncftp and then create a file named transfer.sh, for
>example, containing the following (let's suppose we're transfering file
>foofile from one server to a second one, using a third machine to
>execute the script:

Or, you can use plain old FTP and use a HERE document.  Here's a partial
example which is easy enough to expand:

ftp -i -n servername.tld <<!EOF!
user username
pass password
cd  path/to/file/foofile
get foofile
close
open server2name.tld
user username2
pass password2
cd path/to/file/foofile
put foofile
quit
!EOF!
rm foofile


Granted, this doesn't do it exactly as the first example, but why build
NCFTP if you don't have to.  If you're reasonably intelligent and can do
a little shell scripting, FTP with HERE documents is fine.

-Arf, JT
------------------------------------------------------------------------------
  "Tomorrow is always another day, but don't wait for it to come."
                                            - Brian Post

 Join the UniServe Seti@Home Team: http://www.unisrv.net/computerguys/seti

Unix, Networking and ISP Consulting                             lfm@xxxxxxxxxx
http://www.unisrv.net            MSN IM: S_A_Alis@xxxxxxxxxxx      ICQ 9099687
FurryMUCK (muck.furry.org 8888): S'A'Alis    www.unisrv.net/lfm   MSTie# 21756