文件说它在日志中下载,但不在本地目录中
File says it downloaded in log, but not in local directrory
我正在使用 WinSCP 自动从 FTP 服务器获取。日志显示文件已下载到我指定的目录,但它不在该目录中。
这是调度程序参数。
/log="C:\TEST\Automation\WinSCP.log" /ini=nul /command "open
sftp://HIDDEN:NOTTHATDUMB@ftplocation.com/ -rawsettings TryAgent=0
AuthGSSAPI=0" "put C:\TEST\Automation\*.pgp -nopreservetime -nopermissions"
"get /Inbox/* C:\TEST\Automation\NewFolder" "exit"
日志显示好像文件已下载但找不到文件。
日志输出:
> 2018-05-23 12:07:50.077 Script: get /Inbox/* C:\TEST\Automation\NewFolder
. 2018-05-23 12:07:50.077 Listing directory "/Inbox".
> 2018-05-23 12:07:50.077 Type: SSH_FXP_OPENDIR, Size: 15, Number: 523
< 2018-05-23 12:07:50.155 Type: SSH_FXP_HANDLE, Size: 10, Number: 523
> 2018-05-23 12:07:50.155 Type: SSH_FXP_READDIR, Size: 10, Number: 780
< 2018-05-23 12:07:50.233 Type: SSH_FXP_NAME, Size: 164, Number: 780
> 2018-05-23 12:07:50.233 Type: SSH_FXP_READDIR, Size: 10, Number: 1036
< 2018-05-23 12:07:50.280 Type: SSH_FXP_STATUS, Size: 50, Number: 1036
< 2018-05-23 12:07:50.280 Status code: 1
> 2018-05-23 12:07:50.280 Type: SSH_FXP_CLOSE, Size: 10, Number: 1284
. 2018-05-23 12:07:50.280 FILENAME.txt;-;163487;2018-05-23T16:06:50.000Z;3;"200" [200];"100" [100];rw-------;0
. 2018-05-23 12:07:50.280 ..;D;0;1899-12-30T05:00:00.000Z;0;"" [0];"" [0];---------;0
. 2018-05-23 12:07:50.280 Copying 1 files/directories to local directory "C:\Test\Automation\" - total size: 163,487
. 2018-05-23 12:07:50.280 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: NewFolder
. 2018-05-23 12:07:50.280 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2018-05-23 12:07:50.280 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2018-05-23 12:07:50.280 File: '/Inbox/FILENAME.txt' [2018-05-23T16:06:50.000Z] [163487]
. 2018-05-23 12:07:50.280 Copying "/Inbox/FILENAME.txt" to local directory started.
. 2018-05-23 12:07:50.280 Binary transfer mode selected.
. 2018-05-23 12:07:50.280 Checking existence of partially transferred file.
. 2018-05-23 12:07:50.280 Opening remote file.
> 2018-05-23 12:07:50.280 Type: SSH_FXP_OPEN, Size: 54, Number: 1539
< 2018-05-23 12:07:50.327 Type: SSH_FXP_STATUS, Size: 40, Number: 1284
. 2018-05-23 12:07:50.327 Discarding reserved response
< 2018-05-23 12:07:50.421 Type: SSH_FXP_HANDLE, Size: 10, Number: 1539
> 2018-05-23 12:07:50.421 Type: SSH_FXP_FSTAT, Size: 10, Number: 1800
< 2018-05-23 12:07:50.515 Type: SSH_FXP_ATTRS, Size: 37, Number: 1800
. 2018-05-23 12:07:50.515 Confirming overwriting of file.
> 2018-05-23 12:07:50.515 Type: SSH_FXP_READ, Size: 22, Number: 2053
< 2018-05-23 12:07:50.890 Status code: 1
. 2018-05-23 12:07:50.890 15 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2018-05-23 12:07:50.890 Type: SSH_FXP_CLOSE, Size: 10, Number: 4612
< 2018-05-23 12:07:50.890 Type: SSH_FXP_STATUS, Size: 17, Number: 3589
< 2018-05-23 12:07:50.890 Type: SSH_FXP_STATUS, Size: 17, Number: 3845
< 2018-05-23 12:07:50.921 Type: SSH_FXP_STATUS, Size: 17, Number: 4101
< 2018-05-23 12:07:50.921 Type: SSH_FXP_STATUS, Size: 17, Number: 4357
. 2018-05-23 12:07:50.921 Preserving timestamp [2018-05-23T16:06:50.000Z]
. 2018-05-23 12:07:50.937 Transfer done: '/Inbox/FILENAME.txt' => 'C:\Test\Automation\NewFolder' [163487]
. 2018-05-23 12:07:50.937 Copying finished: Transferred: 163,487, Elapsed: 0:00:00, CPS: 493,279/s
> 2018-05-23 12:07:50.937 Script: exit
. 2018-05-23 12:07:50.937 Script: Exit code: 0
. 2018-05-23 12:07:50.937 Closing connection.
. 2018-05-23 12:07:50.937 Sending special code: 12
. 2018-05-23 12:07:50.937 Sent EOF message
这行日志告诉我它已下载,但是导航到保存位置时显示一个空文件夹。
. 2018-05-23 12:07:50.937 Transfer done: '/Inbox/FILENAME.txt' => 'C:\Test\Automation\NewFolder' [163487]
有什么想法吗?
您的 get
命令语法说:将所有文件从 /Inbox
下载到本地文件夹 C:\Test\Automation
并将它们保存到文件 NewFolder
。是什么有效地使所有文件相互覆盖。假设 NewFolder
folder 实际上是不存在的。如果它存在,下载将失败并出现 "is not file" 错误。
您也肯定使用了一些相当旧版本的 WinSCP。由于最新版本的 WinSCP 会警告您,您可能做错了什么:
Are you sure you want to transfer multiple files to a single file 'NewFolder' in a directory 'C:\Test\Automation\'?
The files will overwrite one another.
If you actually want to transfer all files to a directory 'C:\Test\Automation\NewFolder\', keeping their name, make sure you terminate the path with a slash.
另见 documentation for get
command:
The last parameter specifies target local directory and optionally operation mask to store file(s) under different name. Target directory must end with backslash.
解决方案:
- 添加黑斜线;
- 创建
NewFolder
文件夹;
- 并且您还应该升级到最新版本的 WinSCP。
我正在使用 WinSCP 自动从 FTP 服务器获取。日志显示文件已下载到我指定的目录,但它不在该目录中。
这是调度程序参数。
/log="C:\TEST\Automation\WinSCP.log" /ini=nul /command "open
sftp://HIDDEN:NOTTHATDUMB@ftplocation.com/ -rawsettings TryAgent=0
AuthGSSAPI=0" "put C:\TEST\Automation\*.pgp -nopreservetime -nopermissions"
"get /Inbox/* C:\TEST\Automation\NewFolder" "exit"
日志显示好像文件已下载但找不到文件。
日志输出:
> 2018-05-23 12:07:50.077 Script: get /Inbox/* C:\TEST\Automation\NewFolder
. 2018-05-23 12:07:50.077 Listing directory "/Inbox".
> 2018-05-23 12:07:50.077 Type: SSH_FXP_OPENDIR, Size: 15, Number: 523
< 2018-05-23 12:07:50.155 Type: SSH_FXP_HANDLE, Size: 10, Number: 523
> 2018-05-23 12:07:50.155 Type: SSH_FXP_READDIR, Size: 10, Number: 780
< 2018-05-23 12:07:50.233 Type: SSH_FXP_NAME, Size: 164, Number: 780
> 2018-05-23 12:07:50.233 Type: SSH_FXP_READDIR, Size: 10, Number: 1036
< 2018-05-23 12:07:50.280 Type: SSH_FXP_STATUS, Size: 50, Number: 1036
< 2018-05-23 12:07:50.280 Status code: 1
> 2018-05-23 12:07:50.280 Type: SSH_FXP_CLOSE, Size: 10, Number: 1284
. 2018-05-23 12:07:50.280 FILENAME.txt;-;163487;2018-05-23T16:06:50.000Z;3;"200" [200];"100" [100];rw-------;0
. 2018-05-23 12:07:50.280 ..;D;0;1899-12-30T05:00:00.000Z;0;"" [0];"" [0];---------;0
. 2018-05-23 12:07:50.280 Copying 1 files/directories to local directory "C:\Test\Automation\" - total size: 163,487
. 2018-05-23 12:07:50.280 PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 0100; Resume: S (102400); CalcS: No; Mask: NewFolder
. 2018-05-23 12:07:50.280 TM: B; ClAr: No; RemEOF: No; RemBOM: No; CPS: 0; NewerOnly: No; InclM: ; ResumeL: 0
. 2018-05-23 12:07:50.280 AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; *.js; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2018-05-23 12:07:50.280 File: '/Inbox/FILENAME.txt' [2018-05-23T16:06:50.000Z] [163487]
. 2018-05-23 12:07:50.280 Copying "/Inbox/FILENAME.txt" to local directory started.
. 2018-05-23 12:07:50.280 Binary transfer mode selected.
. 2018-05-23 12:07:50.280 Checking existence of partially transferred file.
. 2018-05-23 12:07:50.280 Opening remote file.
> 2018-05-23 12:07:50.280 Type: SSH_FXP_OPEN, Size: 54, Number: 1539
< 2018-05-23 12:07:50.327 Type: SSH_FXP_STATUS, Size: 40, Number: 1284
. 2018-05-23 12:07:50.327 Discarding reserved response
< 2018-05-23 12:07:50.421 Type: SSH_FXP_HANDLE, Size: 10, Number: 1539
> 2018-05-23 12:07:50.421 Type: SSH_FXP_FSTAT, Size: 10, Number: 1800
< 2018-05-23 12:07:50.515 Type: SSH_FXP_ATTRS, Size: 37, Number: 1800
. 2018-05-23 12:07:50.515 Confirming overwriting of file.
> 2018-05-23 12:07:50.515 Type: SSH_FXP_READ, Size: 22, Number: 2053
< 2018-05-23 12:07:50.890 Status code: 1
. 2018-05-23 12:07:50.890 15 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
> 2018-05-23 12:07:50.890 Type: SSH_FXP_CLOSE, Size: 10, Number: 4612
< 2018-05-23 12:07:50.890 Type: SSH_FXP_STATUS, Size: 17, Number: 3589
< 2018-05-23 12:07:50.890 Type: SSH_FXP_STATUS, Size: 17, Number: 3845
< 2018-05-23 12:07:50.921 Type: SSH_FXP_STATUS, Size: 17, Number: 4101
< 2018-05-23 12:07:50.921 Type: SSH_FXP_STATUS, Size: 17, Number: 4357
. 2018-05-23 12:07:50.921 Preserving timestamp [2018-05-23T16:06:50.000Z]
. 2018-05-23 12:07:50.937 Transfer done: '/Inbox/FILENAME.txt' => 'C:\Test\Automation\NewFolder' [163487]
. 2018-05-23 12:07:50.937 Copying finished: Transferred: 163,487, Elapsed: 0:00:00, CPS: 493,279/s
> 2018-05-23 12:07:50.937 Script: exit
. 2018-05-23 12:07:50.937 Script: Exit code: 0
. 2018-05-23 12:07:50.937 Closing connection.
. 2018-05-23 12:07:50.937 Sending special code: 12
. 2018-05-23 12:07:50.937 Sent EOF message
这行日志告诉我它已下载,但是导航到保存位置时显示一个空文件夹。
. 2018-05-23 12:07:50.937 Transfer done: '/Inbox/FILENAME.txt' => 'C:\Test\Automation\NewFolder' [163487]
有什么想法吗?
您的 get
命令语法说:将所有文件从 /Inbox
下载到本地文件夹 C:\Test\Automation
并将它们保存到文件 NewFolder
。是什么有效地使所有文件相互覆盖。假设 NewFolder
folder 实际上是不存在的。如果它存在,下载将失败并出现 "is not file" 错误。
您也肯定使用了一些相当旧版本的 WinSCP。由于最新版本的 WinSCP 会警告您,您可能做错了什么:
Are you sure you want to transfer multiple files to a single file 'NewFolder' in a directory 'C:\Test\Automation\'?
The files will overwrite one another.
If you actually want to transfer all files to a directory 'C:\Test\Automation\NewFolder\', keeping their name, make sure you terminate the path with a slash.
另见 documentation for get
command:
The last parameter specifies target local directory and optionally operation mask to store file(s) under different name. Target directory must end with backslash.
解决方案:
- 添加黑斜线;
- 创建
NewFolder
文件夹; - 并且您还应该升级到最新版本的 WinSCP。