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
1 answer
34 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 ...
0 votes
0 answers
105 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 /...
1 vote
3 answers
164 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##*/}&...
0 votes
0 answers
375 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:...
0 votes
1 answer
657 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. ...
0 votes
0 answers
731 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 ...
1 vote
0 answers
70 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 ...
1 vote
0 answers
142 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=.* --...
1 vote
0 answers
1k 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://...
2 votes
0 answers
72 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[...
  • 21
0 votes
0 answers
187 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}" \...
0 votes
1 answer
269 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-...
  • 121
1 vote
2 answers
1k 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 ...
  • 5,243
1 vote
2 answers
705 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 ...
1 vote
1 answer
794 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 ...
  • 11
0 votes
0 answers
172 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 ...
1 vote
1 answer
574 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 ...
0 votes
2 answers
10k 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....
  • 121
1 vote
0 answers
45 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 ...
  • 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 ...
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 <--- ...
  • 281
0 votes
0 answers
93 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 ...
  • 169
0 votes
1 answer
210 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 ...
2 votes
1 answer
279 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 ...
1 vote
0 answers
281 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 ...
0 votes
1 answer
985 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. ...
1 vote
1 answer
2k 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/...
  • 11
0 votes
1 answer
2k 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 ...
  • 353
2 votes
1 answer
6k 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 ...
  • 171
1 vote
1 answer
149 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 ...
0 votes
0 answers
905 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 ...
  • 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$ | ...
2 votes
0 answers
1k 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 ...
  • 21
1 vote
1 answer
7k 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 ...
  • 113
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 ...
  • 143
6 votes
1 answer
7k 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-...
  • 61
0 votes
1 answer
641 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 ...
1 vote
1 answer
8k 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 ...
2 votes
1 answer
3k 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. ...
1 vote
1 answer
4k 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 $...
0 votes
1 answer
627 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. ...
  • 143
-1 votes
1 answer
560 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 ...
0 votes
1 answer
297 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 ...
  • 17
1 vote
0 answers
1k views

LFTP --exclude prevents log file creation

Is there a way to use advanced features like --exclude and still keep xfer:log-file "lftpbackup.log" capabilities? I read manual at http://lftp.yar.ru/lftp-man-alt.html also lftp.yar.ru wiki, ...
  • 17
0 votes
1 answer
3k views

Copy specific folders via lftp

I want to copy data using lftp login from server. Here is my command to copy all the data. lftp -u uid,pwd -e 'mirror -c /home/dcr96/TCGA' sftp://rob2056@serapeum2.qib.pbtech This copies the data ...
  • 987
0 votes
2 answers
2k views

Scripting a file move on an FTP Server

I'm attempting to move multiple files on an FTP server to a different directory. So far, I've written a bash script that will login and retrieve any new files in the remote directory but the ftp ...
  • 1
0 votes
1 answer
8k views

Simple question: lftp not writing to $LOG --- what am I doing wrong? [closed]

I use a script for work that invokes lftp to mirror a directory: #!/bin/bash HOST='ftp.example.com" USER='pretenduser' PASS='pretendpass' TARGETFOLDER='/home/pretenduser/Dropbox/lftp' SOURCEFOLDER='/...
1 vote
0 answers
961 views

lftp logging of removed source files

When I use --remove-source-files when pulling files from a remote server, there is no log of files being removed. In theory, one could assume that as long as you're using --remove-source-files that ...
0 votes
1 answer
3k views

How to use lftp to delete old files before downloading new?

I am running lftp on Raspbian I have 100GB of content on the remote site and 100GB space available on my SD card so I need to delete files not present at the remote site from the SD card before ...
  • 233
1 vote
1 answer
814 views

lftp: removes folder prefix while uploading files

I want to upload some files in a local folder to a remote folder thanks to the command line's ftp client lftp. What I want : In my local computer, I do have : me@local $ tree my-site ├── index.html ...
  • 113