With LFTP How do I send a specific file to server overwriting if it exists?

I'm building an production site update script using expect and lftp.I'm trying for sometime to do this simple thing: send a file overwriting if it exists. But I just can't find a command that allow me to overwrite destination on put. put -c just continues if it's the same file. But if it's different it does nothing.Do I really have to check if the file exists and delete it in order to put the file in the server ? isn't there a direct command ?If that's the only option, then there's another thing I couldn't find: a command to see if the file exi...Read more

"tail -F" equivalent in lftp

I'm currently looking for tips to simulate a tail -F in lftp.The goal is to monitor a log file the same way I could do with a proper ssh connection.The closest command I found for now is repeat cat logfile.It works but that not the best when my file is too big cause it displays each time all the file....Read more

codeship - Correct LFTP command to upload only updated files

I am using codeship.io to upload files in a code repository to a shared hosting without SSH. This is the original command, it tooks two hours to complete:lftp -c "open -u $FTP_USER,$FTP_PASSWORD ftp.mydomain.com; set ssl:verify-certificate no; mirror -R ${HOME}/clone/ /public_html/targetfolder"I tried to add -n, which is supposed to upload only newer files. But I can still see from the streaming logs that some unchanged files are being uploaded:lftp -c "open -u $FTP_USER,$FTP_PASSWORD ftp.mydomain.com; set ssl:verify-certificate no; mirror -R -...Read more

lftp remot file has data get to local file is empty

I'm running lftp and I've encountered the strangest error. Whether I run the mirror command or just a normal connection the results are the same. Connect to the remote siteLoginGo to outgoing directoryls see that file have data. get any file disconnectls local, file is empty. It is the most bizarre thing, has anyone seen this before? XXXXXXXXX@XXXXXXXXX ~>lftp sftp://XXXXXXXX -dXXXXXXXXX@XXXXXXXXX ~>lftp XXXXXXX:~> user XXXXXXXXXXXPassword:lftp XXXXX@XXXXX:~> ls---- Running connect program (ssh -a -x -s -l XXXXXXXX sftp)---> send...Read more

lftp file configuration and stored password

I am connecting to some ftp server with lftp.lftp -u login,password -e "ls /someFolderOnTheServer" bla.node.org"Does someone know how I can setup things such that the login and the password are read from some configuration file instead ?many thanks for your valuable help....Read more

Why lftp mirror --only-newer does not transfer "only newer" file?

I want to automate to upload files of my websites. But, remote server does not support ssh, so I try lftp command below instead of rsync.lftp -c "set ftp:use-mdtm no && set ftp:timezone -9 && open -u user,password ftp.example.com && mirror -Ren local_directory remote_directory"If local files are not changed, no files are uploded by this command. But, I change a file and run the command, all files are uploaded.I know lftp/ftp's MDTM problem. So, I tried "set ftp:use-mdtm no && set ftp:timezone -9", but all files a...Read more

Disable MFMT in lftp

How to disable MFMT in lftp?I use lftp mirror command to sync my files with the remote server.Looks like lftp send MFMT command after uploading file. This is undesirable in my case and I would like to turn it off...Read more

LFTP when used with proxies doesn't work

I can't seem to use LFTP with proxies that require authentification correctly on my Ubuntu server.When I use it with proxy that doesn't require username/password everything seems fine:lftp lftp :~> set http:proxy http://HOST:PORT lftp :~> set ftp:proxy http://HOST:PORT lftp :~> open username:password@some.ftp.site.com lftp username@some.ftp.site.com:~> get file.ext file.ext 36352 bytes transferred in 10 seconds (3.5K/s) lftp username@some.ftp.site.com:~> exit but when I have to put username/password there is a problem:lftp lftp :...Read more

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.This week I've decided to do something about it, as now whenever I run the backup script it stalls for 30 minutes while it downloads the filelist needed for the mirror operation. My first action was to create a small script to use ls to echo all of the filenames in that directory to a file. I then ran that file through google sheets to extract sub-po...Read more

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 ftpsite.com; put -O remote/dir/ /local/file.txt"I received the following error: put: Login failed: 530 Box: Invalid user credentials.I tried the second answerlftp -e "put -O remote/dir/ /local/file.txt; bye" -u user,pass ftpsite.comand received the same error.Doing everything step-by-step worked perfectly, i.e.,lftp ftpsite.com -u user,passput -O r...Read more

Run LFTP on a list of files

I have a newline-delimited list of paths to files I would like to download via LFTP, from a remote machine to a local machine with the same directory structure. Is there any way that I can pass LFTP the list of files (the entire path to the file on the remote machine), and have it only download those? My current method is individually passing each file to LFTP, downloading it, and then repeating the same process with the next file until my list is exhausted. Obviously, batching the files to download would be much faster, my current solution fee...Read more

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 $ treemy-site├── index.html└── css/When I go to my FTP server, I want to have :me@ftp_server $ treedev-site/├── index.html└── css/What I want to do is to upload the local content of the my-site dir to the remote dev-site dir; but not the my-site dir itself. So I just want to upload files and remove this directory prefix name.What I tried :I tried this :# On my local computer :$ lsmy...Read more

LFTP if no connection cancel thread and move on

lftp -u user, password -p 2121 -e 'set net:timeout 10; set net:reconnect-interval-base 1; set net:max-retries 1; mirror -R --use-pget-n=10 -v -c /home/[username]/files/sync/. /' {$v[ip]}I have a script that grabs the ip of everything connected to the network and attempts to push a file to it. There will be things on the network that won't allow a connection. There's no way to know in advance what will be on the network and what wont, and I need to find a way for lftp to not hang on a failed connection so the script can move into the next ip/h...Read more

lftp rolls back the transfer process

i am trying to transfer a 2GB file using lftp, the connection is successful, the tranfer starts, but when it reaches 15% (sometime a bit more, sometime a bit less) it starts all over again, it rolls back to 0% and restarts the process, any idea what it could be? my command:lftp -ssl-allow -u 'user,pass' -e "set ftp:ssl-allow true; set ftp:ssl-force true; set ftp:ssl-auth TLS; set ftp:ssl-protect-data true; set ftp:ssl-protect-list true;cd DIR;mput FILENAME;exit" ftps.COMPLETE_HOST...Read more