lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.11k stars 162 forks source link

lftp -e and -o together with put #532

Open bubbster opened 5 years ago

bubbster commented 5 years ago

I am running the following command:

lftp -c 'set net:timeout 10; set ftp:ssl-allow true; set ssl:check-hostname no; open -u {speed2['user']},{speed2['pass']} -e \"cd file-update-log; glob -f --exist BELLO-{id}-flag.txt && put -e /opt/folder/flag.txt -o BELLO-{id}-flag.txt; quit\" {speed2['host']}'

The command checks to see if the file exists and if so, it deletes before upload. However, in this case, I want the source file to upload as a different target filename. The command works great without the -o. However, when I add in the -o to change the target file name, lftp seems to try to delete the target file as the specified lfile (source) instead of rfile (target).

How do I do this? Is it a bug or am I placing the -e in the wrong place? I have also tried placing the -e directly before the -o and directly after the -o without correct results. I also tried it at the end.

lavv17 commented 4 years ago

I cannot reproduce it. Try enabling debug to see what DELE command is sent to the server.