Re: automated FTP

Werner Koch (wernerk@luthien.me.eunet.de)
Sat, 4 May 1996 11:22:42 +0200 (MET DST)


On Thu, 2 May 1996, Boy of "Destiny" wrote:

> I'm trying to tell ftp to send a file from the command line and
> can't get it to work. What I'd like to do is have my dial up script, which
> works fine, update my homepage whenever I logon to my ISP. Any and all help
> is greatly appreciated.

Try this:
---------------
#!/bin/sh
#
# Load the homepages up to the www-server
#-------------------

ftp_server=ftp.geocities.com
ftp_account=anonymous
ftp_password=werner.koch@guug.de
ftp_directory=/pub/homestead
www_account=wk
www_password=secret
files=$(ls *.html *.gif *.zip 2>/dev/null)

(
echo user $ftp_account $ftp_password
echo bin
echo hash
echo cd $ftp_directory
for i in $files; do
echo put $i $i.$www_account.$www_password
done;
echo bye
) | ftp -n -v $ftp_server
-------------------------------

--
Werner Koch, Duesseldorf, phone: +49 211 489529, PGP keyID: 0C9857A5