上下文:我正在使用WinSCP每天将2个报告文件从D:\驱动器上的本地目录传输到客户端远程服务器。我不断提出错误系统找不到指定的路径,我真的不知道为什么会发生这种情况。
我已经检查了这两个文件的目录以及在文件资源管理器中搜索到的正确访问文件的确切目录。在测试期间的几天里,我确实更改了文件名,但将它们完全改回了以前使用的名称。
我认为这可能是缓存问题,所以我手动登录并清除了WinSCP目录缓存。但这并不能解决问题。
问题: 如何解决此问题以允许WinSCP查找正确的目录?问题是否可能是默认本地目录设置为C:\ drive?也许我需要使用UNC命名约定,或者需要在目录路径中包含本地服务器名称?请指教。
再次,我已经在文件资源管理器中检查了目录 D:\ Div32_Daily_Reports \ BICS_Inventory_New_Items \ BICS_Inventory_New_Items ,并且已打开了确切的文件,因此我确定该目录正确。以下是WinSCP日志中有关传输尝试之一的详细信息。
. 2019-09-06 21:59:40.429 Access granted
. 2019-09-06 21:59:40.429 Opening session as main channel
. 2019-09-06 21:59:40.496 Opened main channel
. 2019-09-06 21:59:40.629 Started a shell/command
. 2019-09-06 21:59:40.629 --------------------------------------------------------------------------
. 2019-09-06 21:59:40.629 Using SFTP protocol.
. 2019-09-06 21:59:40.630 Doing startup conversation with host.
> 2019-09-06 21:59:40.630 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2019-09-06 21:59:40.821 Type: SSH_FXP_VERSION, Size: 95, Number: -1
. 2019-09-06 21:59:40.821 SFTP version 3 negotiated.
. 2019-09-06 21:59:40.821 Unknown server extension posix-rename@openssh.com="1"
. 2019-09-06 21:59:40.821 Supports statvfs@openssh.com extension version "2"
. 2019-09-06 21:59:40.821 Unknown server extension fstatvfs@openssh.com="2"
. 2019-09-06 21:59:40.821 We believe the server has signed timestamps bug
. 2019-09-06 21:59:40.821 We will use UTF-8 strings until server sends an invalid UTF-8 string as with SFTP version 3 and older UTF-8 strings are not mandatory
. 2019-09-06 21:59:40.821 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2019-09-06 21:59:40.821 Getting current directory name.
. 2019-09-06 21:59:40.821 Getting real path for '.'
> 2019-09-06 21:59:40.821 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2019-09-06 21:59:40.888 Type: SSH_FXP_NAME, Size: 23, Number: 16
. 2019-09-06 21:59:40.888 Real path is '/'
. 2019-09-06 21:59:40.888 Startup conversation with host finished.
< 2019-09-06 21:59:40.888 Script: Active session: [1] REDACTED
> 2019-09-06 21:59:40.888 Script: synchronize remote D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items /upload/bics_inventory
< 2019-09-06 21:59:40.888 Script: Comparing...
. 2019-09-06 21:59:40.888 Collecting synchronization list for local directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items' and remote directory '/upload/bics_inventory', mode = Remote, params = 0x2 (NoConfirmation), file mask = ''
* 2019-09-06 21:59:40.889 (EOSExtException) Error retrieving file list for "D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*".
* 2019-09-06 21:59:40.889 System Error. Code: 3.
* 2019-09-06 21:59:40.889 The system cannot find the path specified
. 2019-09-06 21:59:40.889 Asking user:
. 2019-09-06 21:59:40.889 Error listing directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items'. ("Error retrieving file list for ""D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*"".","System Error. Code: 3.","The system cannot find the path specified")
< 2019-09-06 21:59:40.889 Script: Error listing directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items'.
< 2019-09-06 21:59:40.889 Script: Error retrieving file list for "D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*".
< 2019-09-06 21:59:40.889 System Error. Code: 3.
< 2019-09-06 21:59:40.889 The system cannot find the path specified
< 2019-09-06 21:59:40.889 Script: Error listing directory 'D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items'.
< 2019-09-06 21:59:40.889 Error retrieving file list for "D:\Div32_Daily_Reports\BICS_Inventory_New_Items\BICS_Inventory_New_Items\*.*".
< 2019-09-06 21:59:40.889 System Error. Code: 3.
< 2019-09-06 21:59:40.889 The system cannot find the path specified
. 2019-09-06 21:59:40.889 Script: Failed
. 2019-09-06 21:59:40.889 Script: Exit code: 1
. 2019-09-06 21:59:40.889 Closing connection.
. 2019-09-06 21:59:40.889 Sending special code: 12
. 2019-09-06 21:59:40.889 Sent EOF message
答案 0 :(得分:0)
好吧,看来我已经解决了这个问题。设置包含实际文件名的文件路径似乎过于精细。
我需要将目录设置为文件所在的文件夹的位置(例如:D:\ Div32_Daily_Reports \ BICS_Inventory_New_Items),然后传输成功。