Automated script to look for files in FTP Server location.

suppose one file comes in one sever location on MOnday.we have to write a script to automatically get that files and put it in different server location.

---------- Post updated at 10:28 AM ---------- Previous update was at 10:27 AM ----------

Please help me on this

you can put this script in cron for automation

ftp -v -n $FTP_SERVER << EOF | tee $LOGFILE
user $FUSER $FPASS
cd $FILE_LOCATION
dir $FILE_TO_BE_FTPD
quit
EOF
   
grep $FILE_TO_BE_FTPD $LOGFILE
if [ $? -eq 0 ]
 then
  echo "FOUND FILE"
ftp -v -n $FTP_SERVER 
user $FUSER $FPASS
cd $FILE_LOCATION
get $FILE_TO_BE_FTPD
quit
EOF
else
     echo "File not found "
fi

I think the third step is to upload the file to another server, which easily done by command put in ftp.

With jville's code, it should be easy for you now.