Re: Script, bash: Help with very simple ftp script
- From: don <donsdx@xxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 17 Dec 2005 16:46:48 GMT
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
.
- Follow-Ups:
- Re: Script, bash: Help with very simple ftp script
- From: houghi
- Re: Script, bash: Help with very simple ftp script
- References:
- Script, bash: Help with very simple ftp script
- From: don
- Re: Script, bash: Help with very simple ftp script
- From: Eberhard Niendorf
- Script, bash: Help with very simple ftp script
- Prev by Date: Several problems with Suse 10
- Next by Date: Re: bootable DVDR
- Previous by thread: Re: Script, bash: Help with very simple ftp script
- Next by thread: Re: Script, bash: Help with very simple ftp script
- Index(es):
Relevant Pages
|