LFTP Cheat Sheet: Enhance Your File Transfer Capabilities
Explore the full potential of LFTP with this detailed cheat sheet. From setting up torrent options, SSH key configurations, to mastering FXP transfers and multi-segment downloading, this guide provides all you need for efficient file management and transfer.
Transfer 20 parallel threads over ssh
Transfer 20 parallel threads over ssh
lftp -u root, -e "
set sftp:connect-program 'ssh -a -x -T -c aes128-gcm@openssh.com -o Compression=no';
set net:limit-total-rate 0;
set fish:connect-program 'ssh -a -x -T -c aes128-gcm@openssh.com -o Compression=no';
mirror --reverse --parallel=20 --use-pget-n=5 site/ /var/www/linux-shell.se/;
quit
" sftp://linux-shell.se
List all files in a tarball 'on-the-fly'
This is my currnet lftpd config
# -------------------------------------------------------------------------------------
# Author https://github.com/lavv17
# https://www.mail-archive.com/lftp@uniyar.ac.ru/
# http://lav.yar.ru/programs.html
# http://lav.yar.ru/hw.html# https://mail.uniyar.ac.ru/mailman/listinfo/lftp
# https://linux.overshoot.tv/wiki/lftp
# https://web.archive.org/web/20111024014512/http://tutorials.papamike.ca/pub/lftp.html
# https://web.archive.org/web/20111024014512/http://tutorials.papamike.ca/pub/lftp.html
# https://web.archive.org/web/20120605031935/http://fryth.com/lftpfaq/
# --------------------------------------------------------------------------------------
debug 5
##########################################
# Set HTTP Settings.
###########################################
set http:set-cookies true
set http:user-agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.9999.99 Safari/537.36"
set http:referer ''
set http:accept-language "Accept-Language: en"
##########################################
# Set SSL Settings.
###########################################
set ssl:verify-certificate no
set ssl:check-hostname no
##########################################
# Set LFTP Prompt.
###########################################
# set prompt "\[\e[0;32m\]┌┼───┤\[\e[1;33m\] [lftp] \[\e[0;36m\]\u\[\e[0;33m\]\@\[\e[0;36m\]\h \[\e[0;32m\]├───┤\[\e[0;33m\]\w\[\e[0;32m\]├───\n└┼─\[\e[1;33m\]$\[\e[0;32m\]─┤► :\[\e[0m\] "
# set prompt "\[\033[m\]|\[\033[1;35m\]\t\[\033[m\]|\[\e[1;31m\]\u\[\e[1;36m\]\[\033[m\]@\[\e[1;36m\]\h\[\033[m\]:\[\e[0m\]\[\e[1;32m\][\W]> \[\e[0m\]"
set prompt "\[\e[1;37m\]lftp\] \[\e[0;32m\]\h\] \w\] \[\e[1;37m\]>\[\e[0m\] "
##########################################
# Set FTP Settings
###########################################
set ftp:fix-pasv-address no
set ftp:passive-mode no
#set ftp:port-ipv4 your.ip.address
#set ftp:port-range minport-maxport (eg. 2000-2050)
##########################################
# Set NET Settings
###########################################
set net:reconnect-interval-base 60
set net:reconnect-interval-multiplier 1
##########################################
# Set BOOKMARK Settings
###########################################
set bmk:save-passwords yes
##########################################
# Set LOG Setting (enabled)
###########################################
set log:enabled 1
set log:level 1
set log:file "lftp.log"
set log:file/xfer "lftp-transfers.log"
set log:max-size 5242880
set log:prefix-error "ERROR: "
set log:prefix-note "NOTE: "
set log:prefix-recv "<- "
set log:prefix-send "-> "
set log:show-ctx true
set log:show-pid true
set log:show-time true
set xfer:log 1
set xfer:eta-period 3
set xfer:log-file "lftp-transfers.log"
# Active (PORT) mode settings
# This allows you to see welcome banners, directory messages, etc.
# Or you can use an even higher debug level to see all FTP messages. # debug 5
# To get a listing of all settings, type set -a, or try the lftp man page.
set ssl:verify-certificate no
Torrent settings
Add ssh key in either way in lftprc
FXP: Server A > Server B
Multi-segment directory downloading with lftp
Connection Timeout
Active Mode
For what it's worth, Active mode -- older, stinkier, and won't go through your firewall:
If you need to put it in a specific local directory
Regular-Expression–Match Upload
Special Characters in Username or Password
FXP Transfer: site 1 > site2
FXP Transfer: site 1 > site2
Download all files from server in 20 parallel transfers
Download all folders inside /mp3/* on ftp to mp3
FXP Between SITE 1 and SITE 2 with 20 threads at same time
Use lftp to multi-threaded download files from websites
Mirrors directory to a ftp server
Mirror a directory structure from websites with an Apache-generated file indexes
Mirror a directory structure from websites with an Apache-generated file indexes
Backup sda partition to ftp (using pipes and gziped backup)
Fastest segmented parallel sync of a remote directory over ssh
Multi-segment directory downloading with lftp
Gets directory and files tree listing from a FTP-server
Resource(s)
- http://lftp.yar.ru/lftp-man.html
- http://mewbies.com/lftp/lftp.html#scripts
- https://web.archive.org/web/20220331040412/http://www.russbrooks.com/2010/11/19/lftp-cheetsheet
- https://dade2.net/kb/complete-lftp-command-tutorial/
- https://www.nr1.nu/linux-shell/network/lftp/
- https://web.archive.org/web/20080309195640/http://tutorials.papamike.ca/pub/lftp.html
- https://www.mail-archive.com/lftp@uniyar.ac.ru/