You can easily mirror the contents of a directory over FTP using the lftp program on Linux. To connect, create a configuration file for lftp that specifies the credentials for the ftp server, the directory on the remote ftp server that you want to download files from, and where you want to place them on the local machine:
1 2 3 4 5 6 |
set ftp:anon-user "ftpusername" set ftp:anon-pass "ftppassword" set ftp:ssl-allow no open remote-ftp-server.com mirror -c /remote/directory/ /local/directory/to/put/files/in exit |
Save this script on your local machine, e.g. /tmp/ftp-mirror . Now, run lftp in a screen session in order to make sure that the transfer continues even if you get disconnected:
1 2 |
screen lftp -f /tmp/ftp-mirror |
Your file transfer will start and once completed you will have a local mirror of all of the files on your ftp server.





