Is there any reason you have to use a basic ftp program? Life will be much easier if you can install ncftpput (part of the ncftp suite). Uploading a directory is pretty simply - I do my backups that way as well. The meat of the upload bit looks something like this:
ncftpput -S .tmp -DD -V -m -r $BACKUP_HOST backups $BACKUP_DIR
upload all of $BACKUP_DIR (because of the -r) to a directory on $BACKUP_HOST called "backups"
delete local files when done uploading (because of the -DD - you probably won't want this)
no output because we're running in a script (from -V)
don't overwrite destination files until the upload is done (from -S .tmp)
make the directory "backups" on $BACKUP_HOST if it doesn't already exist (from -m)
there's a lot of other useful ftp programs -
list the contents of an ftp dir and echo to stdout
get single file or directory (good for scripts as well)
and a nice interactive ftp client.