{"id":982,"date":"2022-01-06T03:00:35","date_gmt":"2022-01-06T03:00:35","guid":{"rendered":"https:\/\/labiol.xyz\/?p=982"},"modified":"2022-01-06T03:00:35","modified_gmt":"2022-01-06T03:00:35","slug":"lftp-advanced-s-ftp-s-client","status":"publish","type":"post","link":"https:\/\/www.labiol.xyz\/index.php\/2022\/01\/06\/lftp-advanced-s-ftp-s-client\/","title":{"rendered":"lftp &#8211; advanced s\/ftp\/s client."},"content":{"rendered":"\n<p>If you are dealing with ftp, ftps or sftp file transfer very likely you already have some favorite client for that purpose. I usually use <a rel=\"noreferrer noopener\" href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\">FileZilla<\/a> which works fantastic in graphical interface regardless it is on Linux\/FreeBSD\/MacOS or even Windows. For cli my first choice is <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/lavv17\/lftp\" target=\"_blank\">lftp<\/a>[1] whenever it is possible. It is maybe not easy to start with this program but it is really powerful. I highly recommend to spend a few moments to familiarize yourself with this product. It will pay off in the future, especially at the moment you will need to resume downloading 100GB file from ftps server like me recently \ud83d\ude42<\/p>\n\n\n\n<p>lftp is available under GNU license:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/3.127.215.50\/wp-content\/uploads\/2022\/01\/obraz-1024x519.png\" alt=\"\" class=\"wp-image-984\" width=\"478\" height=\"242\" srcset=\"https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-1024x519.png 1024w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-300x152.png 300w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-768x389.png 768w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz.png 1070w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><\/figure>\n\n\n\n<p>You can use lftp both, using interactive command or via script.<\/p>\n\n\n\n<p>To start, assuming it is already installed just type <code>lftp<\/code><\/p>\n\n\n\n<p>If you are familiar with regular ftp server, you will be surprised with lots of lftp options:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/3.127.215.50\/wp-content\/uploads\/2022\/01\/obraz-1-1024x142.png\" alt=\"\" class=\"wp-image-986\" width=\"1100\" height=\"152\" srcset=\"https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-1-1024x142.png 1024w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-1-300x42.png 300w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-1-768x107.png 768w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-1-1536x213.png 1536w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-1-2048x285.png 2048w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/figure>\n\n\n\n<p>With lftp command prompt you can <code>set<\/code> ftp option and then connect to the server with command <code>connect<\/code>.<\/p>\n\n\n\n<p>If you need more detailed information, lftp can be run with option <code>-d<\/code><\/p>\n\n\n\n<p>Example (for ftps server):<\/p>\n\n\n\n<p><code>lftp -d<\/code><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/3.127.215.50\/wp-content\/uploads\/2022\/01\/obraz-2.png\" alt=\"\" class=\"wp-image-988\" width=\"365\" height=\"32\" srcset=\"https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-2.png 616w, https:\/\/www.labiol.xyz\/wp-content\/uploads\/2022\/01\/obraz-2-300x26.png 300w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/figure>\n\n\n\n<p>The same options can be set in file ~\/.lftprc.<\/p>\n\n\n\n<p>For script processing program use option -f (<code>lftp -f scriptfile<\/code>)<\/p>\n\n\n\n<p>The simplest scriptfile can have the following content:<\/p>\n\n\n\n<p><code>open SERVER<br>user USERNAME PASSWORD<br>ls<\/code><\/p>\n\n\n\n<p>or<\/p>\n\n\n\n<p><code>open SERVER<br>user USERNAME PASSWORD<br>mirror --verbose -c --use-pget-n=3 DIRECTORYTODOWNLOAD .;<\/code><\/p>\n\n\n\n<p>Of course, lftp provide much more functionality, including file download resume (<code>-c<\/code>). <\/p>\n\n\n\n<p>Documentation:<\/p>\n\n\n\n<p>[1] <a rel=\"noreferrer noopener\" href=\"https:\/\/lftp.yar.ru\/lftp-man.pdf\" target=\"_blank\">https:\/\/lftp.yar.ru\/lftp-man.pdf<\/a><br>[2] <a rel=\"noreferrer noopener\" href=\"https:\/\/unix.stackexchange.com\/questions\/592624\/how-to-connect-to-server-with-tls-using-lftp\" target=\"_blank\">https:\/\/unix.stackexchange.com\/questions\/592624\/how-to-connect-to-server-with-tls-using-lftp<\/a><br>[3] <a rel=\"noreferrer noopener\" href=\"https:\/\/www.librebyte.net\/en\/ftp-en\/lftp-fatal-error-certificate-verification-not-trusted\/\" target=\"_blank\">https:\/\/www.librebyte.net\/en\/ftp-en\/lftp-fatal-error-certificate-verification-not-trusted\/<\/a><br>[4] <a rel=\"noreferrer noopener\" href=\"https:\/\/superuser.com\/questions\/623236\/simple-command-to-connect-to-ftps-server-on-linux-command-line\" target=\"_blank\">https:\/\/superuser.com\/questions\/623236\/simple-command-to-connect-to-ftps-server-on-linux-command-line<\/a><br>[5] <a rel=\"noreferrer noopener\" href=\"https:\/\/danielhoherd.com\/tech-notes\/jdupes\/\" target=\"_blank\">https:\/\/danielhoherd.com\/tech-notes\/jdupes\/<\/a><br>[6] <a rel=\"noreferrer noopener\" href=\"https:\/\/serverok.in\/download-all-files-from-ftp-server-using-lftp\" target=\"_blank\">https:\/\/serverok.in\/download-all-files-from-ftp-server-using-lftp<\/a><br>[7] <a rel=\"noreferrer noopener\" href=\"https:\/\/x8t4.com\/12-lftp-commands-for-managing-files-with-examples\/\" target=\"_blank\">https:\/\/x8t4.com\/12-lftp-commands-for-managing-files-with-examples\/<\/a><br>[8] <a rel=\"noreferrer noopener\" href=\"https:\/\/lftp.yar.ru\/lftp-man.pdf\" target=\"_blank\">https:\/\/lftp.yar.ru\/lftp-man.pdf<\/a><br>[9] <a rel=\"noreferrer noopener\" href=\"https:\/\/www.reddit.com\/r\/linux\/comments\/4anfej\/lftp_segmented_downloads_made_simple\/\" target=\"_blank\">https:\/\/www.reddit.com\/r\/linux\/comments\/4anfej\/lftp_segmented_downloads_made_simple\/<\/a><br>[10] <a rel=\"noreferrer noopener\" href=\"https:\/\/ourcodeworld.com\/articles\/read\/788\/how-to-download-a-remote-directory-with-lftp-sftp-using-a-lftp-script\" target=\"_blank\">https:\/\/ourcodeworld.com\/articles\/read\/788\/how-to-download-a-remote-directory-with-lftp-sftp-using-a-lftp-script<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are dealing with ftp, ftps or sftp file transfer very likely you already have some favorite client for that purpose. I usually use FileZilla which works fantastic in graphical interface regardless it is on Linux\/FreeBSD\/MacOS or even Windows. For cli my first choice is lftp[1] whenever it is &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[],"class_list":["post-982","post","type-post","status-publish","format-standard","hentry","category-freebsd","category-linux"],"_links":{"self":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/982","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=982"}],"version-history":[{"count":7,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/982\/revisions"}],"predecessor-version":[{"id":993,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/posts\/982\/revisions\/993"}],"wp:attachment":[{"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=982"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=982"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.labiol.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=982"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}