Re: Script, bash: Help with very simple ftp script



On 2005-12-16, Eberhard Niendorf wrote:
> don wrote:
>
>> Would someone be kind enough to help me with a very basic
>> script to upload my html files?
>>
> Try this:
> #!/bin/bash
> #
> export PATH=/usr/bin:/bin:/sbin:/usr/sbin:/usr/lib/news/bin
> #
> host="members.cox.net"
> user="donsd"
> password="mypassw"
> file1="*.html"
> file2="*.jpg"
> file3="index.css"
> srcdir="home/don/html"
> FTPLOG="ftp.log"
> ftp -d -v -n $host <<END > $FTPLOG; ERR=$?
> user $user $password
> lcd $srcdir
> prompt off
> mput $file1
> mput $file2
> put $file3
> bye
> END
> if [[ $ERR -ne 0 ]]; then
> echo "Fehler bei FTP ...$?"
> echo "Siehe Debug-File $FTPLOG"
> fi
> exit
> # End
>
> For problems look in the Logfile $FTPLOG ...
>
> EberhardNiendorf

Yes!!!!!!!!!!!! This is what I was looking for. It works.
I had to make one change, the line
srcdir="home/don/html"
should be
srcdir="/home/don/html"

Thank you very much, EberhardNiendorf.

Don
.



Relevant Pages