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.
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.