Scripting 列出WinSCP脚本中的目录时出错

Scripting 列出WinSCP脚本中的目录时出错,scripting,ftp,winscp,Scripting,Ftp,Winscp,我正在创建一个脚本,将一个大文件传输到远程目录 $cat scp.txt option batch abort option confirm off open ftp:PROST:"xxxxxxxx"@216.101.13.11 pwd ls cd /cygdrive/d/Zilla/Rant/Logs lcd D:/Logs put FIX.4.2-DATA.event.current.log.20140921.gz 但它似乎找不到远程目录,即使它确实存在: $ /myc/Program\

我正在创建一个脚本,将一个大文件传输到远程目录

$cat scp.txt

option batch abort
option confirm off
open ftp:PROST:"xxxxxxxx"@216.101.13.11
pwd
ls
cd /cygdrive/d/Zilla/Rant/Logs
lcd D:/Logs
put FIX.4.2-DATA.event.current.log.20140921.gz
但它似乎找不到远程目录,即使它确实存在:

$ /myc/Program\ Files\ \(x86\)/WinSCP/WinSCP.com /script=scp.txt
batch           abort
confirm         off
Connecting to 216.101.13.11 ...
Connected with 216.101.13.11. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] PROST@216.101.13.11
/
Error listing directory '/'.
Could not retrieve directory listing
Can't open data connection for transfer of "/"
(A)bort, (R)etry, (S)kip: Abort
日志文件:

. 2014-09-22 07:25:15.215 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.215 WinSCP Version 5.5.4 (Build 4433) (OS 6.1.7601 Service Pack 1 - Windows Server 2008 R2 Standard)
. 2014-09-22 07:25:15.215 Configuration: HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2014-09-22 07:25:15.215 Local account: xxxxxxxxxxxxxxxxxx
. 2014-09-22 07:25:15.215 Working directory: D:\Logs
. 2014-09-22 07:25:15.215 Process ID: 9484
. 2014-09-22 07:25:15.215 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=554 /consoleinstance=_3388_833 "/script=scp.txt" "/log=./scplog" 
. 2014-09-22 07:25:15.215 Time zone: Current: GMT-4, Standard: GMT-5 (Eastern Standard Time), DST: GMT-4 (Eastern Daylight Time), DST Start: 3/9/2014, DST End: 11/2/2014
. 2014-09-22 07:25:15.216 Login time: Monday, September 22, 2014 7:25:15 AM
. 2014-09-22 07:25:15.216 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.216 Script: Retrospectively logging previous script records:
> 2014-09-22 07:25:15.216 Script: option batch abort
< 2014-09-22 07:25:15.216 Script: batch           abort     
> 2014-09-22 07:25:15.216 Script: option confirm off
< 2014-09-22 07:25:15.216 Script: confirm         off       
> 2014-09-22 07:25:15.216 Script: open ftp:PROST:***@xxx.xxx.xxx.xxx
. 2014-09-22 07:25:15.216 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.216 Session name: PROST@xxx.xxx.xxx.xxx (Modified site)
. 2014-09-22 07:25:15.216 Host name: xxx.xxx.xxx.xxx (Port: 21)
. 2014-09-22 07:25:15.216 User name: PROST (Password: Yes, Key file: No)
. 2014-09-22 07:25:15.216 Tunnel: No
. 2014-09-22 07:25:15.216 Transfer Protocol: FTP
. 2014-09-22 07:25:15.216 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2014-09-22 07:25:15.216 Proxy: none
. 2014-09-22 07:25:15.216 Send buffer: 262144
. 2014-09-22 07:25:15.216 UTF: 2
. 2014-09-22 07:25:15.216 FTP: FTPS: None; Passive: Yes [Force IP: A]; MLSD: A [List all: A]
. 2014-09-22 07:25:15.216 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2014-09-22 07:25:15.216 Cache directory changes: Yes, Permanent: Yes
. 2014-09-22 07:25:15.216 DST mode: 1; Timezone offset: 0h 0m
. 2014-09-22 07:25:15.216 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.217 Connecting to xxx.xxx.xxx.xxx ...
. 2014-09-22 07:25:15.300 Connected with xxx.xxx.xxx.xxx. Waiting for welcome message...
< 2014-09-22 07:25:15.384 220-FileZilla Server version 0.9.45 beta
< 2014-09-22 07:25:15.384 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
< 2014-09-22 07:25:15.384 220 Please visit http://sourceforge.net/projects/filezilla/
> 2014-09-22 07:25:15.384 USER PROST
< 2014-09-22 07:25:15.467 331 Password required for prodny
> 2014-09-22 07:25:15.467 PASS **********
< 2014-09-22 07:25:15.551 230 Logged on
> 2014-09-22 07:25:15.551 SYST
< 2014-09-22 07:25:15.634 215 UNIX emulated by FileZilla
> 2014-09-22 07:25:15.634 FEAT
< 2014-09-22 07:25:15.717 211-Features:
< 2014-09-22 07:25:15.717  MDTM
< 2014-09-22 07:25:15.717  REST STREAM
< 2014-09-22 07:25:15.717  SIZE
< 2014-09-22 07:25:15.717  MLST type*;size*;modify*;
< 2014-09-22 07:25:15.717  MLSD
< 2014-09-22 07:25:15.718  UTF8
< 2014-09-22 07:25:15.718  CLNT
< 2014-09-22 07:25:15.718  MFMT
< 2014-09-22 07:25:15.718 211 End
. 2014-09-22 07:25:15.718 Connected
. 2014-09-22 07:25:15.718 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.718 Using FTP protocol.
. 2014-09-22 07:25:15.718 Doing startup conversation with host.
> 2014-09-22 07:25:15.718 PWD
< 2014-09-22 07:25:15.801 257 "/" is current directory.
. 2014-09-22 07:25:15.801 Getting current directory name.
. 2014-09-22 07:25:15.801 Startup conversation with host finished.
< 2014-09-22 07:25:15.801 Script: Active session: [1] PROST@xxx.xxx.xxx.xxx
> 2014-09-22 07:25:15.801 Script: cd Rant/Logs
. 2014-09-22 07:25:15.801 Cached directory change via "Rant/Logs" to "/Rant/Logs".
. 2014-09-22 07:25:15.801 Getting current directory name.
< 2014-09-22 07:25:15.801 Script: /Rant/Logs
> 2014-09-22 07:25:15.801 Script: pwd
< 2014-09-22 07:25:15.801 Script: /Rant/Logs
> 2014-09-22 07:25:15.801 Script: lcd D:/Logs
< 2014-09-22 07:25:15.801 Script: D:\Logs
> 2014-09-22 07:25:15.801 Script: put FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
. 2014-09-22 07:25:15.802 Copying 1 files/directories to remote directory "/Rant/Logs"
. 2014-09-22 07:25:15.802   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: 
. 2014-09-22 07:25:15.802   TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: 
. 2014-09-22 07:25:15.802   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2014-09-22 07:25:15.802 File: 'FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz' [2014-09-21T21:00:10.230Z] [130873]
. 2014-09-22 07:25:15.802 Copying "FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz" to remote directory started.
. 2014-09-22 07:25:15.802 Binary transfer mode selected.
. 2014-09-22 07:25:15.802 Starting upload of FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
> 2014-09-22 07:25:15.802 CWD /Rant/Logs/
< 2014-09-22 07:25:15.885 250 CWD successful. "/Rant/Logs" is current directory.
> 2014-09-22 07:25:15.885 PWD
< 2014-09-22 07:25:15.978 257 "/Rant/Logs" is current directory.
> 2014-09-22 07:25:15.978 TYPE A
< 2014-09-22 07:25:16.071 200 Type set to A
> 2014-09-22 07:25:16.071 PASV
< 2014-09-22 07:25:16.154 227 Entering Passive Mode (xxx.xxx.xxx.xxx,228,142)
> 2014-09-22 07:25:16.154 MLSD
< 2014-09-22 07:25:26.151 425 Can't open data connection for transfer of "/Rant/Logs"
> 2014-09-22 07:25:26.151 SIZE FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
< 2014-09-22 07:25:26.233 550 File not found
> 2014-09-22 07:25:26.233 MDTM FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
< 2014-09-22 07:25:26.315 550 File not found
> 2014-09-22 07:25:26.315 TYPE I
< 2014-09-22 07:25:26.398 200 Type set to I
> 2014-09-22 07:25:26.398 PASV
< 2014-09-22 07:25:26.482 227 Entering Passive Mode (xxx.xxx.xxx.xxx,228,146)
> 2014-09-22 07:25:26.482 STOR FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
< 2014-09-22 07:25:37.303 425 Can't open data connection for transfer of "/Rant/Logs/FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz"
. 2014-09-22 07:25:37.303 Copying files to remote side failed.
* 2014-09-22 07:25:37.303 (ExtException) **Copying files to remote side failed.**
* 2014-09-22 07:25:37.303 Can't open data connection for transfer of "/Rant/Logs/FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz"
. 2014-09-22 07:25:37.303 Asking user:
. 2014-09-22 07:25:37.303 Error transferring file 'FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz'. ("Copying files to remote side failed.","Can't open data connection for transfer of ""/Rant/Logs/FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz""")
< 2014-09-22 07:25:37.303 Script: Error transferring file 'FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz'.
< 2014-09-22 07:25:37.303 Script: Copying files to remote side failed.

< 2014-09-22 07:25:37.303 Can't open data connection for transfer of "/Rant/Logs/FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz"
* 2014-09-22 07:25:37.304 (EScpSkipFile) Error transferring file 'FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz'.
* 2014-09-22 07:25:37.304 Copying files to remote side failed.
* 2014-09-22 07:25:37.304 Can't open data connection for transfer of "/Rant/Logs/FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz"
. 2014-09-22 07:25:37.304 Script: Failed
. 2014-09-22 07:25:37.304 Script: Exit code: 1
. 2014-09-22 07:25:37.304 Disconnected from server
。2014-09-22 07:25:15.215 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.215 WinSCP版本5.5.4(内部版本4433)(操作系统6.1.7601 Service Pack 1-Windows Server 2008 R2标准)
. 2014-09-22 07:25:15.215配置:HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2\
. 2014-09-22 07:25:15.215本地账户:XXXXXXXXXXXXXXXX
. 2014-09-22 07:25:15.215工作目录:D:\Logs
. 2014-09-22 07:25:15.215过程ID:9484
. 2014-09-22 07:25:15.215命令行:“C:\Program Files(x86)\WinSCP\WinSCP.exe”/console=554/consoleinstance=\u 3388\u 833”/script=scp.txt”“/log=./scplog”
. 2014-09-22 07:25:15.215时区:当前:GMT-4,标准:GMT-5(东部标准时间),夏令时:GMT-4(东部夏时制),夏令时开始:2014年3月9日,夏令时结束:2014年11月2日
. 2014-09-22 07:25:15.216登录时间:2014年9月22日星期一上午7:25:15
. 2014-09-22 07:25:15.216 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.216脚本:回顾性记录以前的脚本记录:
>2014-09-22 07:25:15.216脚本:选项批处理中止
<2014-09-22 07:25:15.216脚本:批处理中止
>2014-09-22 07:25:15.216脚本:选项确认关闭
<2014-09-22 07:25:15.216脚本:确认关闭
>2014-09-22 07:25:15.216脚本:打开ftp:PROST:**@xxx.xxx.xxx.xxx
. 2014-09-22 07:25:15.216 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.216会议名称:PROST@xxx.xxx.xxx.xxx(修改后的站点)
. 2014-09-22 07:25:15.216主机名:xxx.xxx.xxx.xxx(端口:21)
. 2014-09-22 07:25:15.216用户名:PROST(密码:是,密钥文件:否)
. 2014-09-22 07:25:15.216隧道:编号
. 2014-09-22 07:25:15.216传输协议:FTP
. 2014-09-22 07:25:15.216 Ping类型:C,Ping间隔:30秒;超时:15秒
. 2014-09-22 07:25:15.216代理人:无
. 2014-09-22 07:25:15.216发送缓冲区:262144
. 2014-09-22 07:25:15.216 UTF:2
. 2014-09-22 07:25:15.216 FTP:FTPS:None;被动:是[强制IP:A];MLSD:A[列出全部:A]
. 2014-09-22 07:25:15.216本地目录:默认,远程目录:主目录,更新:是,缓存:是
. 2014-09-22 07:25:15.216缓存目录更改:是,永久:是
. 2014-09-22 07:25:15.216 DST模式:1;时区偏移:0小时0米
. 2014-09-22 07:25:15.216 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.217连接到xxx.xxx.xxx.xxx。。。
. 2014-09-22 07:25:15.300与xxx.xxx.xxx.xxx连接。正在等待欢迎消息。。。
<2014-09-22 07:25:15.384 220 FileZilla服务器版本0.9.45 beta
<2014-09-22 07:25:15.384 220由Tim Kosse(Tim。kosse@filezilla-(project.org)
<2014-09-22 07:25:15.384 220请访问http://sourceforge.net/projects/filezilla/
>2014-09-22 07:25:15.384用户前列腺
<2014-09-22 07:25:15.467 331产品需要密码
>2014-09-22 07:25:15.467通行证**********
<2014-09-22 07:25:15.551 230已登录
>2014-09-22 07:25:15.551系统
<2014-09-22 07:25:15.634 215由FileZilla模拟的UNIX
>2014-09-22 07:25:15.634壮举
<2014-09-22 07:25:15.717 211特点:
<2014-09-22 07:25:15.717 MDTM
<2014-09-22 07:25:15.717休息时间
<2014-09-22 07:25:15.717尺码
<2014-09-22 07:25:15.717 MLST型*;大小*;修改*;
<2014-09-22 07:25:15.717百万美元
<2014-09-22 07:25:15.718 UTF8
<2014-09-22 07:25:15.718 CLNT
<2014-09-22 07:25:15.718 MFMT
<2014-09-22 07:25:15.718211结束
. 2014-09-22 07:25:15.718已连接
. 2014-09-22 07:25:15.718 --------------------------------------------------------------------------
. 2014-09-22 07:25:15.718使用FTP协议。
. 2014-09-22 07:25:15.718与主机进行启动对话。
>2014-09-22 07:25:15.718 PWD
<2014-09-22 07:25:15.801257“/”是当前目录。
. 2014-09-22 07:25:15.801获取当前目录名。
. 2014-09-22 07:25:15.801与主机的启动对话已完成。
<2014-09-22 07:25:15.801脚本:活动会话:[1]PROST@xxx.xxx.xxx.xxx
>2014-09-22 07:25:15.801脚本:光盘/日志
. 2014-09-22 07:25:15.801通过“Rant/Logs”将缓存目录更改为“/Rant/Logs”。
. 2014-09-22 07:25:15.801获取当前目录名。
<2014-09-22 07:25:15.801脚本:/Rant/Logs
>2014-09-22 07:25:15.801脚本:pwd
<2014-09-22 07:25:15.801脚本:/Rant/Logs
>2014-09-22 07:25:15.801脚本:lcd D:/Logs
<2014-09-22 07:25:15.801脚本:D:\Logs
>2014-09-22 07:25:15.801脚本:put FIX.4.2-DATA\u FIX\u xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
. 2014-09-22 07:25:15.802将1个文件/目录复制到远程目录“/Rant/Logs”
. 2014-09-22 07:25:15.802时间:是;PrRO:没有;Rght:rw-r--r--;PrR:否(否);FnCs:N;RIC:0100;简历:S(102400);计算:没有;面具:
. 2014-09-22 07:25:15.802 TM:B;克拉尔:没有;主席:没有;雷姆博姆:没有;CPS:0;纽厄尔尼:没有;包括:
. 2014-09-22 07:25:15.802 AscM:*.*html;*。htm;*。txt;*。php;*。php3;*。cgi;*。c、 *。cpp;*。h、 *。pas;*。bas;*。tex;*。pl;*。js。htaccess;*。xtml;*。css;*。cfg;*。ini;*。sh;*。xml
. 2014-09-22 07:25:15.802文件:“FIX.4.2-DATA\u FIX\uxxxxx-FIX-BRIDGE.event.current.log.20140921.gz”[2014-09-21T21:00:10.230Z][130873]
. 2014-09-22 07:25:15.802开始向远程目录复制“FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz”。
. 2014-09-22 07:25:15.802已选择二进制传输模式。
. 2014-09-22 07:25:15.802开始上传FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
>2014-09-22 07:25:15.802 CWD/Rant/Logs/
<2014-09-22 07:25:15.885 250 CWD成功。“/Rant/Logs”是当前目录。
>2014-09-22 07:25:15.885 PWD
<2014-09-22 07:25:15.978 257“/Rant/Logs”是当前目录。
>2014-09-22 07:25:15.978 A类
<2014-09-22 07:25:16.071 200类型设置为A
>2014-09-22 07:25:16.071帕斯卡
< 2014-09-22 07:25:16.154
> 2014-09-22 07:25:26.398 PASV
< 2014-09-22 07:25:26.482 227 Entering Passive Mode (xxx.xxx.xxx.xxx,228,146)
> 2014-09-22 07:25:26.482 STOR FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz
< 2014-09-22 07:25:37.303 425 Can't open data connection for transfer of "/Rant/Logs/FIX.4.2-DATA_FIX_xxxxx-FIX-BRIDGE.event.current.log.20140921.gz"
open ... -passive=off