HOST=remote host name
DIR=/data/Transact/reports/
CONTACT="your email address here"
cd $DIR
ftp -iv $HOST >/tmp/logfile.out 2>&1 <<-EOF
user login password
binary
prompt off
mget file **
bye
EndOfFtp
STATUS=$(grep "transfer complete" logfile.out)
if [ $? -ne 0 ];then
#( mail errors )
mailx -s "Error: get ftp script failed" $CONTACT
< /dev/null > /dev/null 2>&1
fi