Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does linux use lftp to accelerate the download speed of ftp/https

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how linux uses lftp to speed up the download speed of ftp/https". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how linux uses lftp to accelerate the download speed of ftp/https".

Lftp is a file transfer program. It can be used for complex FTP, HTTP/HTTPS, and other connections. If the site URL is specified, then lftp will connect to that site, otherwise the connection will be established using the open command. It is a must-have tool for all Linux/Unix command line users. I've written something about ultra-fast command line download accelerators under Linux, such as Axel and prozilla. Lftp is another tool that can do the same thing, but with more functionality. Lftp can handle several file access methods:

Ftp

Ftps

Http

Https

Hftp

Fish

Sftp

File

So what's so unique about lftp?

Every operation in lftp is reliable, that is, any non-fatal error is ignored and repeated. So if the download is interrupted, it will restart automatically. Even if the FTP server does not support the REST command, lftp attempts to retrieve the file from the beginning until the file transfer is complete.

Lftp has a command syntax similar to shell, which allows you to start multiple commands in parallel in the background.

Lftp has a built-in mirroring feature that can download or update the entire directory tree. There is also a reverse mirroring function (mirror-R), which can upload or update the directory tree on the server. Mirrors can also synchronize directories between two remote servers, using FXP if available.

How to use lftp as download Accelerator

Lftp has a pget command. It allows you to download in parallel. The syntax is:

Lftp-e'pget-n NUM-c url; exit'

For example, use pget to download http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.2.tar.bz2 in five parts:

$cd / tmp $lftp-e'pget-n 5-c http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.2.tar.bz2'

Sample output:

45108964 bytes transferred in 57 seconds (775.3K/s) lftp: ~ > quit

Here:

Pget-downloading files in parallel

-n 5-set the number of * connections to 5

-c-if lfile.lftp-pget-status exists in the current directory, the interrupted transfer continues

How to use lftp in Linux/Unix to speed up ftp/https downloads

Try adding the exit command again:

$lftp-e'pget-n 10-c https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.15.tar.xz; exit' instructions for parallel downloads

Note that by using the download Accelerator, you will increase the load on the remote server. Also note that lftp may not work on sites that do not support multipoint downloads, or the firewall may block such requests.

Other commands provide more functionality. For more information, refer to the man page of lftp:

Man lftp thank you for reading, the above is the content of "how linux uses lftp to accelerate the download speed of ftp/https". After the study of this article, I believe you have a deeper understanding of how linux uses lftp to accelerate the download speed of ftp/https. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report