Questions tagged [lftp]

lftp is a command-line file transfer program for UNIX and Unix-like systems. It started as a FTP client but it also supports FTPS, HTTP, HTTPS, HFTP, FISH, and SFTP. The program also supports FXP and simple BitTorrent protocol support.

Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

lftp for sftp is not working; stuck on `ls' at 0 [Connecting...]

I am having an issue with lftp where it gets stuck on `ls' at 0 [Connecting...] for an SFTP connection. Versions: Linux 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 4 14:55:32 EST 2024 x86_64 x86_64 ...
user3152289's user avatar
0 votes
0 answers
20 views

lftp mirror : exclude zip files in parent directory, but not in subdirectories

I use lftp's mirror command to retrieve data from a FTP server. I want to exclude zip files that are on the parent directory, but not those that are in subdirectories. This command: lftp ftp://...
fdamien12's user avatar
0 votes
0 answers
19 views

lftp crawl for any newly created files and download them

I have just mirrored a remote webserver using lftp's mirror command. However, the webserver updates regularly with newly created files, although it does not update any already existing ones. How can I ...
Anm's user avatar
  • 113
0 votes
0 answers
68 views

How to use lftp to mirror all directories with the same name in source and target

I have folders with the same name on the server and local, where the local folders occasionally update with new files. I have been using mirror -R local/folder/a/ remote/folder/a/ to individually ...
Jae's user avatar
  • 1
0 votes
1 answer
187 views

Using regular expression in lftp to ignore some strings from file name

Get specific file with name like abc_yyyymmdd_hhmmss.csv from directory using mget. Example files in a folder: abc_20221202_145911.csv abc_20221202_145921.csv abc_20221202_145941.csv ...
likeGreen's user avatar
  • 101
1 vote
0 answers
2k views

How to get more details in log for lftp?

I'm fighting with logging on to an FTP server with lftp, and it simply hangs as shown below, despite having tried various things. The text below is all I get from lftp $ lftp lftp :~> debug -o log....
Mads Skjern's user avatar
0 votes
1 answer
106 views

How to use a pipe with lftp?

I have files ending with apk in my desktop pc's terminal: ls | grep apk DroidEdit_v1.23.6.apk I connect to my android phone with lftp from my desktop pc: lftp 192.168.31.130:3721 lftp 192.168.31....
newview's user avatar
  • 205
0 votes
1 answer
319 views

is it possible to use ctrl+z in bash script to send lftp process to background?

we have a database that we take backup from it every night. backup files are 6 separate files in 6 separate directories. after backup is taken successfully, all parts will lftp to a remote server. the ...
BlackCrystal's user avatar
0 votes
1 answer
538 views

Why is LFTP "Removing old file" in mirror?

I'm trying to mirror a website (of which I'm the webmaster) using LFTP, for backup. I use the LFTP command (actual paths, usernames, and passwords redacted for privacy): mirror -e -p --verbose=1 /...
nerdfever.com's user avatar
1 vote
2 answers
488 views

How do you expand a variable in a heredoc as one argument when its value has spaces?

I've created a script to upload via lftp: #! /usr/bin/bash set -xe if [ -n "$1" ]; then # ... else source="." # target=name of current local folder target="${PWD##*/}&...
Daniel Kaplan's user avatar
0 votes
0 answers
2k views

How can I speed up my lftp uploads when I'm mirroring?

Here's my script: #! /usr/bin/bash set -xe local_path="${1-./}" lftp -u user,pass host << EOF set ftp:ssl-allow yes set ftp:ssl-protect-data yes set ftp:ssl-protect-list yes set ftp:...
Daniel Kaplan's user avatar
0 votes
1 answer
3k views

LFTP Script to Download Files and then move them to a remote directory

I found the following LFTP Script to Download Files. The script will fit, but currently it deletes the files after successful transfer. But I want the files to be moved to another directory (e.g. ...
t.weingart's user avatar
0 votes
0 answers
2k views

Copying files from remote to local using lftp in unix

I originally posted this in server fault, but it didn't get much traction. I'm hoping someone here can help. I'm trying to write a script to copy some files from a remote ftp server to a local ...
pbuchheit's user avatar
1 vote
0 answers
243 views

What is a good way test the lftp xfer:timeout feature

Has anyone who has experience with the lftp utility been able to test the xfer:timeout feature? I am switching to lftp client version 4.8.3 and need a way to test xfer:timeout. xfer:timeout (time ...
Phil Rafferty's user avatar
2 votes
0 answers
635 views

How to include only certain folders in lftp mirror?

I want to sync only some folders from an ftp with many folders. Therefore, I'm trying first to exclude everything, and the only list the dirs I want to have explicit: lftp mirror --exclude=.* --...
membersound's user avatar
1 vote
0 answers
3k views

Download file via SFTP one line CLI command with password containing special character (no ssh key)

I've got a Synology that needs to download and archive a file from SFTP server. I used to use WGET when FTP protocol was being used, but the file owner changed the protocol to SFTP. wget -m ftp://...
Kalvin Klien's user avatar
2 votes
0 answers
180 views

lftp from linux to a Mainframe (secure connection tls 1.2)

We are sending a file from the Linux (client) to the Mainframe (server) using lftp. In the mainframe, we can see the following messages when it fails: Aug 24 14:03:38 MVSSYSD/ODPFTP ODPFTP ftps[...
carlos's user avatar
  • 21
0 votes
0 answers
476 views

How to make --exclude-glob work with this use case of lftp and fish shell?

I have a statement that looks like this: set cmd 'set ssl:verify-certificate false; open -u abc,def ftp.somewhere.com; mirror --only-newer --exclude-glob "{.git|node_modules|wp-config.php}" \...
silviubogan's user avatar
0 votes
1 answer
635 views

Sending only one file through lftp

I am trying to create a command line to send files to my server.  Everything is working great to send a folder, but it fails for a single file.  The command I am running is lftp -e "set ftp:ssl-...
Ajouve's user avatar
  • 121
3 votes
2 answers
4k views

How does lftp decide which files need to be transferred when using the mirror command?

The lftp utility has a mirror command which synchronizes a local directory with a directory on the remote server. How does this command decide which files need to be transferred? In particular, if a ...
hugomg's user avatar
  • 5,707
1 vote
2 answers
1k views

How can I specify which cipher lftp is using when connecting to a sftp server?

I'm using lftp to connect to an sftp server but I get a "no matching ciphers" error, and need to specify which cipher is used. Using sftp the command to connect would look like this: sftp -c ...
PetaspeedBeaver's user avatar
1 vote
1 answer
3k views

Automating SFTP using LFTP

I have a weekly file transfer to one of our vendors that I am trying to automate. They require that we transfer the file using sftp. We login to their SFTP server using a userid and password. My ...
Chris's user avatar
  • 11
0 votes
0 answers
529 views

How to send email with log output if script fails

I have the following script template I've been writing to use LFTP to mirror remote files to a local folder for clients. If the mirror fails, I'd like it to send an email with the output that was ...
Justin Buckley's user avatar
1 vote
1 answer
1k views

What is the detriment to downloading too many files in parallel through lftp?

I'm downloading files in parallel through lftp onto a remote server, and I use the commands: lftp ftp:*url* cd into directory mirror --parallel=10 I'm downloading a total of 365 files separated ...
Mollie Passacantando's user avatar
1 vote
2 answers
20k views

How to connect to server with TLS using LFTP?

I'm trying to connect to a server that needs TLS using LFTP. I'm trying in this way, but I get error sslv3 alert when I try to use any command ls, put, pget, etc. lftp set ftp:ssl-force true connect X....
Ger Cas's user avatar
  • 131
1 vote
0 answers
81 views

File permissions while sending the file from one Linux host to another host

One of the source servers is sending the files to destination servers using lftp. The umask setting in the destination host is 007(in proftpd.conf file), so the files landing in the destination ...
A.K's user avatar
  • 55
0 votes
0 answers
2k views

How to show a progress bar for lftp script for newer version of lftp in 2020?

I have read this question and its answer, but they do not answer my question. The shell script is this: let total=$(lftp -f lftp-script-count.txt | wc -l)-2 lftp -f lftp-script.txt | while read ...
silviubogan's user avatar
1 vote
1 answer
2k views

"lftp" on RHEL6 fails to connect to vsftpd on RHEL7

I have configured vsftpd on RHEL7 and i am trying to transfer data to it using lftp from RHEL6. lftp seems to fail after sending the PASS command for anonymous login. ---> USER anonymous <--- ...
Fazlin's user avatar
  • 281
0 votes
0 answers
134 views

lftp can't download files used by another process

I am trying to download logs from azure hosted linux app service. The old logs works nice, but when downloading current log the lftp said: mget: Access failed: 550 The process cannot access the file ...
andrej's user avatar
  • 171
0 votes
1 answer
383 views

Get remote files by a list preserving their relative paths, and do it on a remote machine

1) I run SSH session on the remote client to get files from the server. 2) There is a server and it keeps a very broad directory structure. 3) I've got a list of thousands path-names to the files ...
darkSideOfTheMoon's user avatar
2 votes
1 answer
768 views

I have a process (left) that is stuck, and I can't kill it. (kill -9 does not work), what to do?

I have a process that I ran under a Tmux session that I cannot kill. I have tried kill, kill -9, and a few other kill numbers, without it having any effect. I killed the tmux session successfully ...
Development 4.0's user avatar
1 vote
0 answers
392 views

LFTP script file arguments

I've got an issue while using LFTP with some script files. lftp -f download.lftp the script looks something like that for now: open -u someurl mirror -i "somefile*.zip" --only-missing ... somehow ...
user3066027's user avatar
0 votes
1 answer
1k views

Redhat 7 : Where to find LFTP 4.8.3

I have Red Hat 7 on the server and LFTP 4.4.8. I had to use a CentOS RPM to upgrade to LFTP 4.4.8. I need to upgrade to a more recent version because some option are not available in LFTP 4.4.8. ...
ramsey_lewis's user avatar
1 vote
1 answer
3k views

LFTP exclude specific folder only

I have same folder name in different sub-directories, but while mirroring I want to exclude specific folder only. Example : I have directory "123" in different directories ./abc/123/ ./abc/xyz/...
Jeff A's user avatar
  • 11
0 votes
1 answer
3k views

Unable to connect to remote server using lftp

I'm trying to establish a new ftps connection between two servers, say A and B. Below are the commands I'm using for establishing the connection. I guess i'm able to connect to the remote server but ...
ashish_k's user avatar
  • 375
2 votes
1 answer
8k views

LFTP - Remove files from remote server while uploading via lftp mirror --reverse

I'm using a shell script which executes lftp mirror --reverse to upload files and directories to a remote server. Just before that it removes everything using glob -a rm -r -f *. The problem is, it is ...
Prolog's user avatar
  • 171
1 vote
1 answer
234 views

How to update a local mirror from a public server?

I already have a mirror of the entire slackware64-current/ directory tree using wget -r -np -R "index.html*" https://mirror.slackbuilds.org/slackware/slackware64-current/ and that's fine. But it's ...
John Forkosh's user avatar
0 votes
0 answers
1k views

FTPS - LFTP problem

We have some trouble in my company with ftps access with a provider. Here is our configuration: Ubuntu 14.04 LFTP | Version 4.6.3a Our_cert.crt our_key.key provider.crt AuthorityRoot.crt ...
ydl's user avatar
  • 1
1 vote
1 answer
2k views

Can lftp get take in a variable name?

I want to have a script that uses lftp to download a zip file with a variable name. Currently I have the following: open server user user pass set ssl:verify-certificate no ls -ltA1 | grep .zip$ | ...
andrei1015's user avatar
2 votes
0 answers
2k views

lftp mirror error

I have a problem with a script that I am trying to write. Ideally, the script should compress the folders and then send the zipped files to the ftp server creating the folder as the name of the ...
Peppe J's user avatar
  • 21
3 votes
1 answer
12k views

lftp user credentials do not work with -e or -c

I would like to use lftp to put a file in a remote directory and exit in one command. Following the top answer to this question about this very task, I tried the following: lftp -c "open -u user,pass ...
duckmayr's user avatar
  • 133
1 vote
1 answer
2k views

Why would an lftp mirror operation slow down over time?

I have CCTV server that is backed up daily to a remote ftp server using an lftp command. The CCTV server saves videos to a new folder each day, the backup runs once a day at 1am, so each backup only ...
Martin KS's user avatar
  • 143
7 votes
1 answer
11k views

Ubuntu - lftp will not connect to ftps site (Fatal error: gnutls_handshake: An unexpected TLS packet was received.)

I have a specific ftps site that I cannot connect to with lftp. When I attempt to connect I get the error: Fatal error: gnutls_handshake: An unexpected TLS packet was received When I use gnutls-...
Ptier's user avatar
  • 71
0 votes
1 answer
752 views

LFTP adds ";type=i" to remote file name

I'm using LFTP version 4.7.8 under cygwin. It automatically adds ";type=i" (or ";type=a" if I do put -a) to remote file name. What's more, mv command does not work : mv: Operation not supported: 501 ...
ExpertNoob's user avatar
2 votes
1 answer
10k views

Can't use LFTP with SFTP but SFTP clients allow connections

I'm trying to use LFTP (v 4.8.3) to connect to my KVM. This server already allows me to remote execute SSH through terminal and SFTP through FTP client (Transmit app). I want to do this in order to ...
Jimmy Adaro's user avatar
2 votes
1 answer
4k views

How to synchronise a specific file to a remote FTP server using lftp?

I'm trying to synchronise one file (among other things) using lftp. Even though the docs say that --file=FILE mirror a single file or globbed group (e.g. ...
Jānis Elmeris's user avatar
1 vote
1 answer
5k views

Lftp PASV incorrect?

When connecting to a ftp via terminal, everthing is fine. When using lftp instead, I'm constantly getting timed out and can never sync the folder content. But why? script.sh: lftp -c " debug open $...
membersound's user avatar
0 votes
1 answer
693 views

lftp issues with large directory: ls & mv

I have been backing up files from a CCTV camera to an FTP directory without really thinking about it for about 6 months, and inadvertently created a directory with what might be 100,000 files in it. ...
Martin KS's user avatar
  • 143
-1 votes
1 answer
662 views

ftp multiple files to another server via loop

I try to transfer huge amount(578) of file among of 774 files with ftp. I have the file name which should transfer. the file name format is like : TS_20170818_171102_17.csv and it's not a in same ...
meysam 's user avatar
0 votes
1 answer
334 views

lftp changes directory size without changing files in directory

i used this code to backup a directory to an ftp mirror -R /media/root/7CBAA4537758FCA/SAVE/DeesBootCD_SlipStreamed2/ /luksftpmnt/put-into-images-folder/DeesBootCD_SlipStreamed2 and it worked well ...
alex's user avatar
  • 17