LFTP Unknown command `; ''

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'

#Download from the host
lftp -f "
open $HOST
user $USER $PASS
lcd $LOCAL
mirror --verbose --only-newer --exclude .git/ $REMOTE $LOCAL
quit
"

echo "Download Complete"
+4
source share
1 answer

Just ran into the same problem using a sample script and found a solution in another forum. The correct command is:

lftp -e ...

Greetings

+5
source

Source: https://habr.com/ru/post/1526222/


All Articles