Pargles
Pargles

Reputation: 97

LFTP mirror access fails for existing remote folder

I am trying to use LFTP to mirror a remote FTP running on Windows (that's all I know about the configuration of it. Also, I just have reading access)

I'm running the following shell script:

#!/bin/bash
HOST='omitted'
USER='omitted'
PASS='omitted'
LOCALFOLDER="omitted"
REMOTEFOLDER="/Initial data/Practice area/Intellectual Property/"


lftp -f "
debug -o debug.text 9
open $HOST
user $USER $PASS
cd '$REMOTEFOLDER'
ls
mirror --reverse --verbose '$REMOTEFOLDER' '$LOCALFOLDER'
bye
"

After running it, I get the following output:

source: Is a directory
drwxr-xr-x 1 ftp ftp              0 Mar 23  2017 03.17.17 
drwxr-xr-x 1 ftp ftp              0 Nov 05  2016 2016.10.03
drwxr-xr-x 1 ftp ftp              0 Nov 05  2016 2016.10.07
drwxr-xr-x 1 ftp ftp              0 Feb 23  2017 2017.02.21
drwxr-xr-x 1 ftp ftp              0 Feb 26  2017 2017.02.24
drwxr-xr-x 1 ftp ftp              0 Mar 02  2017 2017.02.27
drwxr-xr-x 1 ftp ftp              0 Apr 11  2017 2017.03.17
drwxr-xr-x 1 ftp ftp              0 Mar 28  2017 2017.03.27
drwxr-xr-x 1 ftp ftp              0 Apr 04  2017 2017.03.31
drwxr-xr-x 1 ftp ftp              0 Aug 09 08:34 2017.04.06
drwxr-xr-x 1 ftp ftp              0 Jun 07  2017 2017.05.31
drwxr-xr-x 1 ftp ftp              0 Jul 17 10:52 2017.07.17
drwxr-xr-x 1 ftp ftp              0 Feb 19  2017 New Folder
mirror: Access failed: /Initial data/Practice area/Intellectual Property: No such file or directory

As you can see, I can list all files inside of the folder that I want to mirror but the mirror command fails.

And following is the debug output:

---- Resolving host address...
---- 1 address found: <omitted>
---- Connecting to <omitted> (<omitted>) port <omitted>
<--- 220 Welcome to <omitted>
---> FEAT
<--- 211-Features:
<---  MDTM
<---  REST STREAM
<---  SIZE
<---  MLST type*;size*;modify*;
<---  MLSD
<---  UTF8
<---  CLNT
<---  MFMT
<--- 211 End
---> CLNT lftp/4.6.3a
<--- 200 Don't care
---> OPTS UTF8 ON
<--- 530 Please log in with USER and PASS first.
---> USER <omitted>
<--- 331 Password required for <omitted>
---> PASS <omitted>
<--- 230 Logged on
---> CLNT lftp/4.6.3a
<--- 200 Don't care
---> OPTS UTF8 ON
<--- 200 UTF8 mode enabled
---> PWD
<--- 257 "/" is current directory.
---- CWD path to be sent is `/Initial data/Practice area/Intellectual Property'
---> CWD Initial data
<--- 250 CWD successful. "/Initial data" is current directory.
---> CWD Practice area
<--- 250 CWD successful. "/Initial data/Practice area" is current directory.
---> CWD Intellectual Property
<--- 250 CWD successful. "/Initial data/Practice area/Intellectual Property" is current directory.
---> PASV
<--- 227 Entering Passive Mode (<omitted>)
---- Connecting data socket to (<omitted>) port <omitted>
---- Data connection established
---> LIST
<--- 150 Connection accepted
---- Got EOF on data connection
---- Closing data socket
<--- 226 Transfer OK
**** /Initial data/Practice area/Intellectual Property: No such file or directory
---> QUIT
<--- 221 Goodbye
---- Closing control socket

I really appreciate if you have any idea of what's wrong :)

Thanks,

Upvotes: 1

Views: 10094

Answers (1)

lav
lav

Reputation: 1481

Remove the --reverse option which is for uploading to the server.

Upvotes: 4

Related Questions