The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 12-19-2006
berlin_germany berlin_germany is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 17
Following FTP steps has solved the problem.

ftp -vn $HOST <<END_SCRIPT > $LOG/delete_files.log 2>&1
quote USER username
quote PASS password
bin
prompt off
cd $PICKUP
mget *
bye
END_SCRIPT

EXIT_STATUS=$?
if [[ $EXIT_STATUS -ne 0 ]]
then
mailx -s \'"Files FTP failed'" user@xyz.com < $MSG/ftp_fail.msg
exit 1
else
mailx -s \'"Files FTP successful'" user@xyz.com < $MSG/ftp_succ.msg
fi
exit 0