2014-09-22 4 views
1

큰 파일을 원격 디렉터리로 전송하는 스크립트를 만듭니다.WinSCP 스크립트의 디렉터리를 나열하는 중 오류가 발생했습니다.

$ 고양이

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 

을 scp.txt 그러나 존재에도 불구하고 원격 디렉토리를 찾을 수가 없습니다 :

$ /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] [email protected] 
/
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: [email protected] (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 ([email protected]) 
< 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] [email protected] 
> 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 
+0

나는 [세션 \ 기본 % 20Settings] .... winscp.ini 및 오류 코드 2에서 변경할 수없는 디렉토리가 없어 제거. 희망을 당신을 돕는. –

답변

2
> 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" 

서버가 firewa 뒤에있는 것 같습니다. 방화벽이 FTP 데이터 연결을 허용하도록 올바르게 구성되어 있지 않습니다.

패시브 모드 전송을 위해 서버가 사용하는 포트에서 방화벽이 인바운드 연결을 허용하는지 확인해야합니다.

자세한 내용은 내 가이드 network configuration for FTP passive mode을 참조하십시오.


또는 WinSCP와 함께 활성 모드를 사용해 볼 수 있습니다.

open ... -passive=off 

가 작동하려면 활성 모드로 도움을 확률이 낮다, 일반적으로

https://winscp.net/eng/docs/scriptcommand_open를 참조하십시오, 당신은 당신의 로컬 방화벽은 데이터 채널에 대한 개방이 필요합니다.

+0

로그 파일을 편집으로 추가했습니다 – ManInMoon

+0

Martin, 이상한 점은 winSCP 대신 FileZilla를 사용하면 작동한다는 것입니다 ... – ManInMoon

+0

그게 - 고마워요. – ManInMoon