I'm assuming you are using lftp (ftp client). In this case it is pretty simply to write a scrit for exact that purpose.
Usage: lftp [OPTS] <site>
`lftp' is the first command executed by lftp after rc files
-f <file> execute commands from the file and exit
-c <cmd> execute the commands and exit
--help print this help and exit
--version print lftp version and exit
Other options are the same as in `open' command
-e <cmd> execute the command just after selecting
-u <user>[,<pass>] use the user/password for authentication
-p <port> use the port for connection
<site> host name, URL or bookmark name
So lftp -f example.ftp will read the commands in example.ftp. This file could contain something like:
So it would just be lftp -f example.ftp > output.log
. You will need to adjust the paramter for ftp and the lftp command to match other ftp clients of course.