How about python? As a plus, it should work more or less unmodified on any OS. And the even bigger plus is that it is more flexible that using the other, more brittle, methods.
It would go something like this:
from ftplib import FTP
import os
ftp = FTP("server")
ftp.login("id", "passwd")
ftp.cwd("/server/ftpdir/")
#copy every file as usual to local system
filelist = []
ftp.retrlines('LIST', filelist.append)
### the list filelist will have one element per file
### which you will have to cut up into the proper pieces
### among Python's installed files on your system is
### the script Tools/scripts/ftpmirror.py which has such code
### it starts at around line 140 (for python 2.6.1)
### --- not very long but this margin is too small to contain it
### assume the file names are in dictionary filedict
### keys are filenames and values are file sizes
for fname in filedict.keys():
localfname = os.path.join(localdir, fname) # set localdir to cwd or whatever
lf = open(localfname , "wb")
ftp.retrbinary('RETR ' + fname, lf.write)
lf.close()
#refresh remote directory listing into filedict2 as with previous filedict
for fname in filedict2.keys():
if fname not in filedict:
# new file since download started! ignore. it's for later
pass
else:
if filedict[fname] == filedict2[fname]:
# apparently we got a good copy so delete the file on ftp server
ftp.delete(fname)
else:
# delete local file: remote was being uploaded or something
os.unlink(os.path.join(localdir, fname))
You have to add error checking and other such stuff. The same could be accomplished with perl and it would probably look about the same.