I'm running the following script that uses lftp:
lftp -f "
open sftp://myuser@sftp_server:443
lcd $FTP_FOLDER
mirror --no-empty-dirs --only-newer --verbose $FTP_FOLDER $LOCAL_FOLDER
bye
"
Now If I've already passed my public key to the server administrator so if do this in the command line:
sftp -P 443 myuser@sftp_server
I get connected and I get the sftp prompt. When I do this the pwd command tells me that the folder that I need to sync has the path "/0Datos" and that is the value of $FTP_FOLDER.
When I execute the script I get this:
source: Is a directory
Password:
Is there any way to connect without the server asking me for a password (I don't have it) in order to sync the folder 0Datos to a local folder of mine?