View Single Post

   
  #11 (permalink)  
Old 04-24-2008, 04:43 PM
Tony Lawrence
 
Posts: n/a
Default Re: Scripted FTP transfer

On Apr 24, 3:04 am, bco...@example.com wrote:
> In article <fukbc8$mej$1$8300d...@news.demon.co.uk>, Julian Brett wrote:
> > Hi all.

>
> > I'm attempting to script an FTP transfer on my UnixWare 7.1.4 server. I've
> > written numerous FTP transfer scripts before, but haven't really approached
> > it this way.

>
> This sort of thing in a script file has always worked for me
> under various unixen:
>
> cd_dir="somedir"
> file="somefile.txt"
> user="myusername"
> host="myhost.com"
> echo -n "Password for ${user} at ${host}: "
> read pass
>
> echo "
> open ${host}
> user ${user} ${pass}
> #passive
> bin
> hash
> prompt
> cd ${cd_dir}
> pwd
> ls
> chmod 700 *
> mdele *
> put ${file}
> chmod 000 *
> ls
> " | ftp -n


Really? And how do you know when it fails and WHERE it failed?

You don't, and that's why I recommend doing this with Perl. It's easy
(I have sample scripts at the links I gave above) and you have total
control of errors..

Reply With Quote