Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LFTP Unknown command `;'

Tags:

bash

ftp

lftp

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"
like image 644
Paige Avatar asked Feb 10 '14 18:02

Paige


1 Answers

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,

like image 188
Istvan Avatar answered Sep 19 '22 11:09

Istvan