I am trying to use LFTP to pull a new file from the server, and the thing seems to work quite well. However, every time I run the script, I get the message "Unknown command`;" followed by my echo "Download complete". I dug a lot of resources and it seems that I see nothing wrong, here is the script, I hope someone more qualified can find my error.
#!/bin/bash
HOST='sftp://host'
USER='user'
PASS='password'
REMOTE='/remote/dir'
LOCAL='/local/dir'
lftp -f "
open $HOST
user $USER $PASS
lcd $LOCAL
mirror --verbose --only-newer --exclude .git/ $REMOTE $LOCAL
quit
"
echo "Download Complete"
Paige source
share