【问题标题】:Issue in downloading files from FTP to local server using Winscp in SSIS在 SSIS 中使用 Winscp 将文件从 FTP 下载到本地服务器的问题
【发布时间】:2018-07-26 12:27:36
【问题描述】:

我无法使用 SSIS(执行进程任务)和 Winscp 下载任何文件。 我关注了各种论坛,并能够创建一个 SSIS 包。我不确定我哪里出错了。

我遵循的步骤:-

 Execute Process Task :- 
i) In Executable I wrote "C:\Program Files (x86)\WinSCP\WinSCP.exe"
ii)In Arguments :- /script=C:\Users\abcd\Desktop\efgh\remotelocal.txt
iii) Working directory :- C:\Users\abcd\Desktop\efgh (I believe this is required for the location where file needs to be saved)

在 Remotelocal.txt 我有以下脚本:-

option batch abort
option confirm off
open ftpes://ghteyeriygvs:%69%315694598665@00.000.000.000/ (this is dummy value)
option transfer binary
cd ./wfgh/
get *.* C:\Users\abcd\Desktop\egfh
close
exit

在执行这个包我得到以下错误

[执行进程任务] 错误:在“C”处执行“C:\Program Files (x86)\WinSCP\WinSCP.exe”“/script=C:\Users\abcd\Desktop\efgh\remotelocal.txt” :\Users\abcd\Desktop\efgh", 进程退出代码为“1”,而预期为“0”。

【问题讨论】:

标签: ssis ssis-2012 winscp winscp-net ssis-2017


【解决方案1】:
get *.* C:\Users\abcd\Desktop\egfh

嗯。我不确定这是否是一个有效的命令。它可能需要:

get *.* C:\Users\abcd\Desktop\egfh\

或者:

lcd C:\Users\abcd\Desktop\egfh\
get *.* 

但是,解决此问题的问题是 WinSCP 引发了错误。 SSIS 无法记录该错误,但您可以告诉 WinSCP 创建日志。

在 SSIS 中,在 Execute Process Task 中,将 WinSCP 的参数更改为:

/script=C:\Users\abcd\Desktop\efgh\remotelocal.txt

这样的:

/script=C:\Users\abcd\Desktop\efgh\remotelocal.txt /xmllog="M:\SSIS\Alexandria Patron Export\WinSCPLog.xml"

我选择 XML 日志而不是标准日志,因为标准日志更冗长,更难看出发生了什么。如果您想要该日志,请尝试:

/script=C:\Users\abcd\Desktop\efgh\remotelocal.txt /log="M:\SSIS\Alexandria Patron Export\WinSCPLog.log"

现在尝试运行你的包,看看 WinSCP 记录了哪些错误。

【讨论】:

  • 虽然对于调试问题,标准日志是imo更好。无论如何都要 +1
  • @MartinPrikryl 嗯,常规日志更像是调试日志,我从不需要它,但显然对应用程序的开发人员很有意义!当我从 WinSCP 收到错误时,这些问题总是属于“临时网络问题”或“愚蠢的供应商更改了文件名并且没有告诉我”或“愚蠢的供应商使他们的 SHA 指纹无效并且没有告诉我” .我不必担心“愚蠢的供应商有古怪的 SFTP 实施”。我只关心连接和文件传输成功或失败的错误位置,这就是 XML 日志捕获的全部内容。
  • >命令“cd”的参数太多。知道为什么我会收到此错误吗?
  • @mehtat_90 如果路径中有空格,请务必用双引号括起来。
猜你喜欢
  • 1970-01-01
  • 2017-09-24
  • 2013-03-11
  • 1970-01-01
  • 1970-01-01
  • 2014-07-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多