Web Development

General discussion


FTP Script

By ifisher ·
I have an ftp batch script that I am using within a bat file. Is there anyway to capture/query the results of the ftp script. For instance, I would like to be able to tell if ftp error code 552 resulted during a file upload. I am capturing the ftp output but don't know how to utilize within my bat file. For instance, can I somehow use the 'find' command to do this?

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

The best way to deal with this

by DanLM In reply to FTP Script

would actualy to code for errors within your script. here is how I did it in a shell script for a unix box

ftp -i -v -n ftp.droolin.org <<END_FTP > $HOME/Unreal3.2/config/damnit.txt

That was the ftp to a home server with all display output being directed to damnit.txt

Here is the check against that file for an error.

grep '530 Login incorrect.' $HOME/Unreal3.2/config/damnit.txt > $HOME/Unreal3.2/config/damnit1.txt
if test -s $HOME/Unreal3.2/config/damnit1.txt
notify_email "Subject: Incorrect password was specified for $SERVERNAME. FTP update has aborted"


Related Discussions

Related Forums