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 answer
lftp -e "put -O remote/dir/ /local/file.txt; bye" -u user,pass ftpsite.com
and received the same error.
Doing everything step-by-step worked perfectly, i.e.,
lftp ftpsite.com -u user,pass
put -O remote/dir/ /local/file.txt
bye
but I have to do this for many files. I would like to be able to do this in one command to run it as part of a script. Any tips on how to fix this error, or where to look/start?