Recursively Download a directory via ftp

I will be using lftp instead of regular ftp. Since I would like to automate the process using cron, I will be using a script file for the list of commands.

First create the script file:

#cat ../dforcescript.lftp
open -u username,password ftp.droid-force.com
mirror backups ./

Here, I have specified that once logged in, the directory backups is to be mirrored to a directory backups in the current directory. The trailing / indicates that the directory name is to be recreated here.

Now execute lftp with:

#lftp -f ../dforcescript.lftp
---- Connecting to ftp.droid-force.com (93.182.179.9) port 21
<--- 220 ProFTPD 1.3.3a Server (freja.c0urier.net) [::ffff:10.1.0.10]
<--- 230 User [email protected] logged in
<--- 250 CWD command successful