retry process in ftp

hi #!/bin/bash
SERVER=10.89.40.35
USER=xyz
PASSWD=xyz

ftp -in $SERVER<<EOF
user $USER $PASSWD
mkdir PPL
cd /path of remote dir
lcd /path of local dir
hash
bin
put <file name>
bye
<<EOF

The above ftp script i have to schedule in crontab at a particular instance of time run daily.
In the above ftp script i have to implement a retry process.
So that in the case if the transfer is stopped in between ftp for any reasons then after a gap of 15 mins the ftp session again retry to do the ftp.

This is done so that the person at remote server where the files are to be dumped get an idea that some problem lies in connectivity if ftp fails..after a no. of retries .

PLS if anybody cld help in writin the code for it..

no cyber chat forms please... :slight_smile:

probably i could help with you an idea..

for ftp transfers,
include site checksums to verify the transfer
and the size of the file, whether they do match or not
and of course the successful transfer message ( check from the RFC's ) .

If any of them gives unsatisfactory results then necessarily the job needs to be scheduled.
Kind of more idea would be to have a list of files to be transferred and a marker about the transfer status of the file in a seperate (special) file and update the special file accordingly based on the run.. so next time running by cron.. no need to specify the file to be transferred again

hope that gives an idea

Hey..i need..a..unix...ftp script..which transfers a file to sme other server..and if the transfer is succesfull then the file is moved to smeother directory...and if not..then..it shld remain in same directory.....

..pls if anybody..cld..help writin..d same..!!