在 SSIS 中使用 Winscp 从 FTP 下载文件到本地服务器时出现问题
Issue in downloading files from FTP to local server using Winscp in SSIS
我无法使用 SSIS(执行进程任务)和 Winscp 下载任何文件。
我关注了各种论坛并能够创建一个 SSIS 包。我不确定我哪里出错了。
Steps I followed:-
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
执行这个包时出现以下错误
[Execute Process Task] Error: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=C:\Users\abcd\Desktop\efgh\remotelocal.txt" at "C:\Users\abcd\Desktop\efgh", The process exit code was "1" while the expected was "0".
get *.* C:\Users\abcd\Desktop\egfh
嗯。我不确定这是否是一个有效的命令。可能需要:
get *.* C:\Users\abcd\Desktop\egfh\
或者:
lcd C:\Users\abcd\Desktop\egfh\
get *.*
但是,解决此问题的问题是它是 WinSCP 引发的错误。 SSIS 无法记录该错误,但您可以告诉 WinSCP 创建一个日志。
在 SSIS 中,在执行进程任务中,将 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 记录了哪些错误。
我无法使用 SSIS(执行进程任务)和 Winscp 下载任何文件。 我关注了各种论坛并能够创建一个 SSIS 包。我不确定我哪里出错了。
Steps I followed:-
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
执行这个包时出现以下错误
[Execute Process Task] Error: In Executing "C:\Program Files (x86)\WinSCP\WinSCP.exe" "/script=C:\Users\abcd\Desktop\efgh\remotelocal.txt" at "C:\Users\abcd\Desktop\efgh", The process exit code was "1" while the expected was "0".
get *.* C:\Users\abcd\Desktop\egfh
嗯。我不确定这是否是一个有效的命令。可能需要:
get *.* C:\Users\abcd\Desktop\egfh\
或者:
lcd C:\Users\abcd\Desktop\egfh\
get *.*
但是,解决此问题的问题是它是 WinSCP 引发的错误。 SSIS 无法记录该错误,但您可以告诉 WinSCP 创建一个日志。
在 SSIS 中,在执行进程任务中,将 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 记录了哪些错误。