FTP between two UNIX servers

Hi

I have server A and server B.

On server B the directory is called /tmp/hmp
On server A I want to get the files on server B:/tmp/hmp via FTP. After I have got the files via FTP I have to delete them. In the script below I'm affraid of that I delete files before I get them by ftp.

#!/bin/bash
ftp -in server B<<END_SCRIPT
quote USER abc
quote PASS XXXX
bin
prompt off
cd /tmp/hmp --folder on ftp
lcd /production/hmp --folder on local drive
mget *.*
mdel *.*
bye
END_SCRIPT

Usually ftp clients work serialized so nothing should be deleted before you have transferred them.
You can also just try it out with some dummy files.

Also it's good to post scripts/code with the [ code ] and [ /code ] tags.