我正在使用 winscp 脚本从 FTP 服务器下载文件,直到昨天都还正常,但今天它一直断开连接。我不知道今天发生了什么变化?但是,我能够使用 filezilla 等 GUI 进行连接。
脚本:
"C:\Program Files (x86)\WinSCP\WinSCP.com" /rawconfig Interface\SessionReopenAutoStall=90000 /log="D:\old\winscp_log\winscp_%yymmdd_hhmmss%.log" /command ^
"option batch abort" ^
"open ftps://***t@***ws.com:%Password%@***.sharefileftp.com/DBS/DB_BACKUP -hostkey="*****" -passive=on" ^
"get * E:\DBS\DB_BACKUP" ^
"exit"
winscp 日志:
Mon 12/28/202010:34:50.72
. 2020-12-28 10:34:52.189 --------------------------------------------------------------------------
. 2020-12-28 10:34:52.189 WinSCP Version 5.13.3 (Build 8565) (OS 10.0.14393 - Windows Server 2016 Standard)
. 2020-12-28 10:34:52.189 Configuration: Command-line options overriding HKCU\Software\Martin Prikryl\WinSCP 2\
. 2020-12-28 10:34:52.189 Log level: Normal
. 2020-12-28 10:34:52.189 Local account: I-TECH\test1
. 2020-12-28 10:34:52.189 Working directory: D:\BATCH_FILES
. 2020-12-28 10:34:52.189 Process ID: 6016
. 2020-12-28 10:34:52.205 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=5.13.3 /consoleinstance=_5492_275 "/rawconfig" Interface\SessionReopenAutoStall=60000 "/log=D:\old\winscp_log\winscp_20201228_103450.log" "/command" "option batch abort" "open ftps://***@***.com:***@****.sharefileftp.com/ -hostkey=**** -rawsettings PingType=1 -passive=on" "synchronize -mirror local E:\DBS\DB_BACKUP /DBS/DB_BACKUP" "exit"
. 2020-12-28 10:34:52.205 Time zone: Current: GMT+5:30 (India Standard Time), No DST
. 2020-12-28 10:34:52.205 Login time: Monday, December 28, 2020 10:34:52 AM
. 2020-12-28 10:34:52.205 --------------------------------------------------------------------------
. 2020-12-28 10:34:52.205 Script: Retrospectively logging previous script records:
> 2020-12-28 10:34:52.205 Script: option batch abort
< 2020-12-28 10:34:52.205 Script: batch abort
> 2020-12-28 10:34:52.205 Script: open ftps://****@****.com:***@****.sharefileftp.com/ -hostkey=**** -rawsettings PingType=1 -passive=on
. 2020-12-28 10:34:52.205 --------------------------------------------------------------------------
. 2020-12-28 10:34:52.205 Session name: ***/support@****.com@****.sharefileftp.com (Ad-Hoc site)
. 2020-12-28 10:34:52.205 Host name: ***.sharefileftp.com (Port: 990)
. 2020-12-28 10:34:52.205 User name: ***/support@***.com (Password: Yes, Key file: No, Passphrase: No)
. 2020-12-28 10:34:52.205 Transfer Protocol: FTP
. 2020-12-28 10:34:52.205 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2020-12-28 10:34:52.205 Disable Nagle: No
. 2020-12-28 10:34:52.205 Proxy: None
. 2020-12-28 10:34:52.205 Send buffer: 262144
. 2020-12-28 10:34:52.205 UTF: Auto
. 2020-12-28 10:34:52.205 FTPS: Implicit TLS/SSL [Client certificate: No]
. 2020-12-28 10:34:52.205 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2020-12-28 10:34:52.205 Session reuse: Yes
. 2020-12-28 10:34:52.205 TLS/SSL versions: TLSv1.0-TLSv1.2
. 2020-12-28 10:34:52.205 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2020-12-28 10:34:52.205 Cache directory changes: Yes, Permanent: Yes
. 2020-12-28 10:34:52.205 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2020-12-28 10:34:52.205 Timezone offset: 0h 0m
. 2020-12-28 10:34:52.205 --------------------------------------------------------------------------
. 2020-12-28 10:34:52.767 Connecting to ***.sharefileftp.com:990 ...
. 2020-12-28 10:34:53.158 Connected with ***.sharefileftp.com:990, negotiating TLS connection...
. 2020-12-28 10:34:53.283 Verifying certificate for "Citrix Systems, Inc." with fingerprint 8c:6e:4a:04:d7:42:5f:eb:88:72:e0:22:91:a4:f2:72:fd:f1:0e:83 and 20 failures
. 2020-12-28 10:34:53.283 Certificate common name "*.sharefileftp.com" matches hostname
. 2020-12-28 10:34:53.283 Certificate for "Citrix Systems, Inc." matches configured fingerprint
. 2020-12-28 10:34:53.283 Using TLSv1.2, cipher TLSv1/SSLv3: ECDHE-RSA-AES128-SHA, 2048 bit RSA, ECDHE-RSA-AES128-SHA SSLv3 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA1
. 2020-12-28 10:34:53.283 TLS connection established. Waiting for welcome message...
< 2020-12-28 10:34:53.345 220 ftp-ap.sharefileftp.com FTP Server Ready (SSL)
> 2020-12-28 10:34:53.345 USER ***/support@***.com
< 2020-12-28 10:34:53.392 331 Hello ***/support@***.com, please enter your password.
> 2020-12-28 10:34:53.392 PASS *******************
< 2020-12-28 10:34:55.986 230-Connection established from static-***-tataidc.co.in [14.**.1.58].
< 2020-12-28 10:34:56.049 230-You are connected as ** (invoices@***.com).
< 2020-12-28 10:34:56.049 230 Welcome to the iTech FTP site.
> 2020-12-28 10:34:56.049 SYST
< 2020-12-28 10:34:56.580 215 UNIX Type: L8
> 2020-12-28 10:34:56.580 FEAT
< 2020-12-28 10:34:56.627 211-Extensions supported:
< 2020-12-28 10:34:56.705 EPSV
< 2020-12-28 10:34:56.705 MDTM
< 2020-12-28 10:34:56.705 PASV
< 2020-12-28 10:34:56.705 REST STREAM
< 2020-12-28 10:34:56.705 SIZE
< 2020-12-28 10:34:56.705 UTF8
< 2020-12-28 10:34:56.705 PBSZ
< 2020-12-28 10:34:56.705 PROT
< 2020-12-28 10:34:56.705 X-NOVELLABS
< 2020-12-28 10:34:56.705 X-CITRIX
< 2020-12-28 10:34:56.705 211 End.
> 2020-12-28 10:34:56.705 OPTS UTF8 ON
< 2020-12-28 10:34:56.752 200 OK.
> 2020-12-28 10:34:56.752 PBSZ 0
< 2020-12-28 10:34:56.783 200 OK.
> 2020-12-28 10:34:56.783 PROT P
< 2020-12-28 10:34:56.830 200 Data connections set to secure (SSL) mode
. 2020-12-28 10:34:56.830 Connected
. 2020-12-28 10:34:56.830 --------------------------------------------------------------------------
. 2020-12-28 10:34:56.830 Using FTP protocol.
. 2020-12-28 10:34:56.830 Doing startup conversation with host.
> 2020-12-28 10:34:56.830 PWD
< 2020-12-28 10:34:56.877 257 "/"
. 2020-12-28 10:34:56.877 Getting current directory name.
. 2020-12-28 10:34:56.877 Startup conversation with host finished.
< 2020-12-28 10:34:56.877 Script: Active session: [1] ***/support@***.com@***.sharefileftp.com
> 2020-12-28 10:34:56.892 Script: synchronize -mirror local E:\DBS\DB_BACKUP /DBS/DB_BACKUP
< 2020-12-28 10:34:56.892 Script: Comparing...
. 2020-12-28 10:34:56.892 Collecting synchronization list for local directory 'E:\DBS\DB_BACKUP' and remote directory '/DBS/DB_BACKUP', mode = Local, params = 0x1002 (NoConfirmation, Mirror), file mask = ''
. 2020-12-28 10:34:56.892 Local file 'E:\DBS\DB_BACKUP\.' [2020-12-27T07:25:36.201Z] [0] excluded from synchronization
. 2020-12-28 10:34:56.892 Local file 'E:\DBS\DB_BACKUP\..' [2020-12-27T07:25:36.201Z] [0] excluded from synchronization
. 2020-12-28 10:34:56.892 Retrieving directory listing...
> 2020-12-28 10:34:56.892 CWD /DBS/DB_BACKUP
< 2020-12-28 10:34:57.564 250 "/DBS/DB_BACKUP" is the current directory.
> 2020-12-28 10:34:57.564 PWD
< 2020-12-28 10:34:57.595 257 "/DBS/DB_BACKUP"
> 2020-12-28 10:34:57.595 TYPE A
< 2020-12-28 10:34:57.642 200 ASCII mode selected. (Note: This server treats ASCII mode identically to Binary mode.)
> 2020-12-28 10:34:57.642 PASV
< 2020-12-28 10:34:57.689 227 Entering Passive Mode (54,254,202,61,173,62)
> 2020-12-28 10:34:57.689 LIST -a
. 2020-12-28 10:34:57.689 Connecting to 54.254.202.61:44350 ...
. 2020-12-28 10:35:12.236 Timeout detected. (data connection)
. 2020-12-28 10:35:12.236 Could not retrieve directory listing
. 2020-12-28 10:35:12.236 LIST with -a failed, will try pure LIST
< 2020-12-28 10:35:12.236 Script: Connecting to ***.sharefileftp.com:990 ...
. 2020-12-28 10:35:12.236 Connecting to ***.sharefileftp.com:990 ...
. 2020-12-28 10:35:12.283 Connected with ***.sharefileftp.com:990, negotiating TLS connection...
. 2020-12-28 10:35:12.392 Verifying certificate for "Citrix Systems, Inc." with fingerprint 8c:6e:4a:04:d7:42:5f:eb:88:72:e0:22:91:a4:f2:72:fd:f1:0e:83 and 20 failures
. 2020-12-28 10:35:12.392 Certificate common name "*.sharefileftp.com" matches hostname
. 2020-12-28 10:35:12.392 Certificate for "Citrix Systems, Inc." matches configured fingerprint
. 2020-12-28 10:35:12.392 Using TLSv1.2, cipher TLSv1/SSLv3: ECDHE-RSA-AES128-SHA, 2048 bit RSA, ECDHE-RSA-AES128-SHA SSLv3 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA1
< 2020-12-28 10:35:12.392 Script: TLS connection established. Waiting for welcome message...
. 2020-12-28 10:35:12.392 TLS connection established. Waiting for welcome message...
< 2020-12-28 10:35:12.486 220 ftp-ap.sharefileftp.com FTP Server Ready (SSL)
> 2020-12-28 10:35:12.486 USER ***/support@***.com
< 2020-12-28 10:35:12.517 331 Hello ***/support@***.com, please enter your password.
> 2020-12-28 10:35:12.517 PASS *******************
< 2020-12-28 10:35:15.080 230-Connection established from static-58.1.97.14-tataidc.co.in [14.97.1.58].
< 2020-12-28 10:35:15.158 230-You are connected as Sivakumar Narayanaswamy (invoices@***.com).
< 2020-12-28 10:35:15.158 230 Welcome to the iTech FTP site.
> 2020-12-28 10:35:15.158 SYST
< 2020-12-28 10:35:15.752 215 UNIX Type: L8
> 2020-12-28 10:35:15.752 FEAT
< 2020-12-28 10:35:15.799 211-Extensions supported:
< 2020-12-28 10:35:15.877 EPSV
< 2020-12-28 10:35:15.877 MDTM
< 2020-12-28 10:35:15.877 PASV
< 2020-12-28 10:35:15.877 REST STREAM
< 2020-12-28 10:35:15.877 SIZE
< 2020-12-28 10:35:15.877 UTF8
< 2020-12-28 10:35:15.877 PBSZ
< 2020-12-28 10:35:15.877 PROT
< 2020-12-28 10:35:15.877 X-NOVELLABS
< 2020-12-28 10:35:15.877 X-CITRIX
< 2020-12-28 10:35:15.877 211 End.
> 2020-12-28 10:35:15.877 OPTS UTF8 ON
< 2020-12-28 10:35:15.924 200 OK.
> 2020-12-28 10:35:15.924 PBSZ 0
< 2020-12-28 10:35:15.971 200 OK.
> 2020-12-28 10:35:15.971 PROT P
< 2020-12-28 10:35:16.018 200 Data connections set to secure (SSL) mode
< 2020-12-28 10:35:16.018 Script: Connected
. 2020-12-28 10:35:16.018 Connected
. 2020-12-28 10:35:16.018 Doing startup conversation with host.
< 2020-12-28 10:35:16.018 Script: Starting the session...
> 2020-12-28 10:35:16.018 PWD
< 2020-12-28 10:35:16.064 257 "/"
. 2020-12-28 10:35:16.064 Changing directory to "/".
> 2020-12-28 10:35:16.064 CWD /
< 2020-12-28 10:35:16.830 250 "/" is the current directory.
. 2020-12-28 10:35:16.830 Getting current directory name.
> 2020-12-28 10:35:16.830 PWD
< 2020-12-28 10:35:16.877 257 "/"
. 2020-12-28 10:35:16.877 Startup conversation with host finished.
< 2020-12-28 10:35:16.877 Script: Session started.
. 2020-12-28 10:35:16.877 Retrieving directory listing...
> 2020-12-28 10:35:16.877 CWD /DBS/DB_BACKUP
< 2020-12-28 10:35:17.705 250 "/DBS/DB_BACKUP" is the current directory.
> 2020-12-28 10:35:17.705 PWD
< 2020-12-28 10:35:17.736 257 "/DBS/DB_BACKUP"
> 2020-12-28 10:35:17.736 TYPE A
< 2020-12-28 10:35:17.783 200 ASCII mode selected. (Note: This server treats ASCII mode identically to Binary mode.)
> 2020-12-28 10:35:17.783 PASV
< 2020-12-28 10:35:17.830 227 Entering Passive Mode (54,***,202,61,147,126)
> 2020-12-28 10:35:17.830 LIST
. 2020-12-28 10:35:17.830 Connecting to 54.***.202.61:37758 ...
. 2020-12-28 10:35:32.236 Timeout detected. (data connection)
. 2020-12-28 10:35:32.236 Could not retrieve directory listing
. 2020-12-28 10:35:32.236 Connection was lost, asking what to do.
. 2020-12-28 10:35:32.236 Asking user:
. 2020-12-28 10:35:32.236 Lost connection. ("Timeout detected. (data connection)","Could not retrieve directory listing")
< 2020-12-28 10:35:32.236 Script: Lost connection.
< 2020-12-28 10:35:32.236 Script: Timeout detected. (data connection)
< 2020-12-28 10:35:32.236 Could not retrieve directory listing
FileZilla 日志:
2020-12-28 19:09:36 780 1 Status: Resolving address of ****.sharefileftp.com
2020-12-28 19:09:42 780 1 Status: Connecting to 54.***.202.61:990...
2020-12-28 19:09:43 780 1 Status: Connection established, initializing TLS...
2020-12-28 19:09:43 780 1 Status: Verifying certificate...
2020-12-28 19:09:43 780 1 Status: TLS connection established, waiting for welcome message...
2020-12-28 19:09:43 780 1 Response: 220 ftp-ap.sharefileftp.com FTP Server Ready (SSL)
2020-12-28 19:09:43 780 1 Command: USER ***
2020-12-28 19:09:43 780 1 Response: 331 Hello ***, please enter your password.
2020-12-28 19:09:43 780 1 Command: PASS *******************
2020-12-28 19:09:45 780 1 Response: 230-Connection established from (unknown) [106.78.85.229].
2020-12-28 19:09:45 780 1 Response: 230-You are connected as ***(invoices@****.com).
2020-12-28 19:09:45 780 1 Response: 230 Welcome to the *** FTP site.
2020-12-28 19:09:45 780 1 Command: SYST
2020-12-28 19:09:46 780 1 Response: 215 UNIX Type: L8
2020-12-28 19:09:46 780 1 Command: FEAT
2020-12-28 19:09:46 780 1 Response: 211-Extensions supported:
2020-12-28 19:09:46 780 1 Response: EPSV
2020-12-28 19:09:46 780 1 Response: MDTM
2020-12-28 19:09:46 780 1 Response: PASV
2020-12-28 19:09:46 780 1 Response: REST STREAM
2020-12-28 19:09:46 780 1 Response: SIZE
2020-12-28 19:09:46 780 1 Response: UTF8
2020-12-28 19:09:46 780 1 Response: PBSZ
2020-12-28 19:09:46 780 1 Response: PROT
2020-12-28 19:09:46 780 1 Response: X-NOVELLABS
2020-12-28 19:09:46 780 1 Response: X-CITRIX
2020-12-28 19:09:46 780 1 Response: 211 End.
2020-12-28 19:09:46 780 1 Command: OPTS UTF8 ON
2020-12-28 19:09:46 780 1 Response: 200 OK.
2020-12-28 19:09:46 780 1 Command: PBSZ 0
2020-12-28 19:09:46 780 1 Response: 200 OK.
2020-12-28 19:09:46 780 1 Command: PROT P
2020-12-28 19:09:46 780 1 Response: 200 Data connections set to secure (SSL) mode
2020-12-28 19:09:46 780 1 Status: Logged in
2020-12-28 19:09:46 780 1 Status: Retrieving directory listing...
2020-12-28 19:09:46 780 1 Command: PWD
2020-12-28 19:09:46 780 1 Response: 257 "/"
2020-12-28 19:09:46 780 1 Command: TYPE I
2020-12-28 19:09:46 780 1 Response: 200 Binary mode selected.
2020-12-28 19:09:46 780 1 Command: PASV
2020-12-28 19:09:46 780 1 Response: 227 Entering Passive Mode (54,***,202,61,144,163)
2020-12-28 19:09:46 780 1 Command: LIST
2020-12-28 19:09:47 780 1 Response: 125 Secure data connection open; transfer starting.
2020-12-28 19:09:47 780 1 Response: 226-Transferred 1,190 bytes.
2020-12-28 19:09:47 780 1 Response: 226 Closing data connection.
2020-12-28 19:09:47 780 1 Status: Directory listing of "/" successful
2020-12-28 19:14:17 780 1 Status: Retrieving directory listing of "/DBS"...
2020-12-28 19:14:17 780 1 Command: CWD DBS
2020-12-28 19:14:18 780 1 Response: 250 "/DBS" is the current directory.
2020-12-28 19:14:18 780 1 Command: PWD
2020-12-28 19:14:18 780 1 Response: 257 "/DBS"
2020-12-28 19:14:18 780 1 Command: PASV
2020-12-28 19:14:18 780 1 Response: 227 Entering Passive Mode (54,****,202,61,179,251)
2020-12-28 19:14:18 780 1 Command: LIST
2020-12-28 19:14:19 780 1 Response: 125 Secure data connection open; transfer starting.
2020-12-28 19:14:19 780 1 Response: 226-Transferred 311 bytes.
2020-12-28 19:14:19 780 1 Response: 226 Closing data connection.
2020-12-28 19:14:19 780 1 Status: Directory listing of "/DBS" successful