Subject: Terminate FTP on error

From: Russel Lunt <[email-masked]>
Date: Tue, 25 May 1999 15:37:45 +0200

Hi all,

Just a quick request.  I'm trying to find source-code or a binary for an FTP
client that will terminate on any error, rather than simply reporting to
stdout and terminating ok.  Can anybody help?

Russel Lunt
'A six shooter always beats four aces'.

--
******************************************************************************
The use of the Truworths e-mail facility is not permitted for the distribution
of chain letters or offensive email of any nature whatsoever.  Truworths
hereby distances itself from and accepts no liability in respect of the
unauthorised use of its e-mail facility or the sending of e-mail
communications for other than strictly business purposes.  Truworths
furthermore disclaims liability for any unauthorised instruction for which
permission was not granted.
Any recipient of an unacceptable communication, a chain letter or offensive
material of any nature is requested to report it to [email-masked]

---

From: "Callaway, John" <[email-masked]>
Date: Tue, 25 May 1999 11:08:26 -0400

You can use expect to automate ftp scripts.  

Here is a short expect script that sends one file as an example.  It will
report an error if any command fails.

#! /usr/local/bin/expect

if { [llength $argv] < 2 } {
	send_error "Usage: ftp.exp  <local filename> <remote filename>\n"
	exit 1
}

set status 0
set fileName [lindex $argv 0]
set rFileName [lindex $argv 1]

spawn /usr/bin/ftp -niv ftp.server.com
expect -nocase "ftp>" {send "user myuser mypass\r"} \
	timeout {send_error "\nUnable to connect\n"
		exit 1 }
expect -nocase "230" {send "put $fileName $rFileName\r"} \
	timeout {send_error "\nUnable to log on\n"
		exit 1 }
expect -nocase "226 transfer complete" {send "bye\r"} \
		"ftp>" {send_error "\nUnable to send file $fileName\n"
		exit 1 }
expect -nocase "goodbye" {} \
	timeout {send_error "\nDid not receive goodbye\n"
		exit 1 }

-----Original Message-----
From: Russel Lunt [mailto:[email-masked]]
Sent: Tuesday, May 25, 1999 9:38 AM
To: Wu-Ftpd (E-mail)
Subject: Terminate FTP on error

Hi all,

Russel Lunt

--
****************************************************************************
**
The use of the Truworths e-mail facility is not permitted for the
distribution