I will agree with sea that sftp would be better, but I assume that the target doesn't support it.
Could I suggest that you change the code to this to ensure that the credentials are not displayed for anyone to see with a ps -ef | grep ftp :-
ftp -nv $targethost << EOFTP >$logfile.$$
user $userid $password
cd $targetdirectory
get or put command here
quit
EOFTP
Long running FTP jobs can give far too much away to a curious user. We have our set so that every transfer has it's own set of credentials and target directory. That way if we need to change a password, then only one transfer is affected. It's a pain to stick to, but the impact of a required change makes it worthwhile.
Using $logfile.$$ also allows you to keep a history of FTP attempts in case you are re-running or have many processes that use the same basic script. You can read the log file looking for errors or success as required. make sure that you have a process to tidy them away later on.