Paige
Paige

Reputation: 685

LFTP Unknown command `;'

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"

Upvotes: 5

Views: 4451

Answers (1)

Istvan
Istvan

Reputation: 86

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,

Upvotes: 7

Related Questions