我正在尝试使用LFTP来镜像在Windows上运行的远程FTP(这就是我对它配置的全部了解。另外,我只有阅读权限(
我正在运行以下外壳脚本:
#!/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
"
运行后,我得到以下输出:
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
如您所见,我可以列出要镜像的文件夹中的所有文件,但镜像命令失败。
以下是调试输出:
---- 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
如果您知道出了什么问题,我将不胜感激:)
谢谢
删除用于上传到服务器的--reverse选项。