Upload all files to FTP server using lftp

lftp allow you to upload all files and sub folders using single command. With normal ftp command, you need to use put/mput command many times to do the same.

To download all files from FTP server, use “mirror” command. mirror command also allow you to upload files to remote server by specifying -R (reverse mirror) option.

This is very useful for uploading files from SSH shell account.

For help, use ? in lftp command prompt. To get help for specific command use

Exampe

To upload all files from local folder to remote server, run

Following will upload vshare2.7 folder to FTP root folder.

See lftp

Download all files from FTP server using lftp

lftp is a command line FTP client, that can be used to download all files from a remote FTP server to local folder.

This is useful when you want to move migrate site from one server to another.

To download all files from FTP server, create an empty folder and change to it.

Run lftp command to connect to remove FTP server.

This will connect you to FTP server. Run following 2 commands as needed. First command will disable SSL, this is required if remote FTP server have no SSL installed. Second command will enable active FTP mode, will be useful if passive FTP don’t work for you.

Change the folder that you need to download and run

This will download everything from remote FTP server to your local folder.

You can use options

Here -c is for continue, will help with resume if you get disconnected or want to mirror again.

–parallel=10 will tell lftp to download 8 files in parallel instead of files one by one.

See lftp