I am trying to use LFTP to pull down new file from a server and thing seem to be working fairly well. However, every time I run the script, I get an "Unknown command `;'" error followed by my echo "Download Complete". I have dug through a ton of resources and can't seem to see anything wrong, here is the script, hopefully someone more skilled 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"
Just ran into the same problem by using a sample script and found a solution on another forum. The right command to issue is:
lftp -e ...
Cheers,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With