拜托,我需要帮助仅将当前日期的文件从本地目录加载到 SFTP 服务器。显然,SSIS 中的 FTP Task 不能移动到 SFTP,只能移动到 FTP。
此外,我有 FileZilla。我可以在 SSIS 中使用 FileZilla 吗?或者我可以让 FileZilla 在特定时间自动发送文件吗? (使用 Windows 10)
最佳答案
您不能使用 FileZilla。 FileZilla 不支持任何类型的脚本。
还有许多其他可编写脚本的 SFTP 客户端。
使用 WinSCP 可以轻松完成您的任务,因为它有一个语法来选择今天的文件。
您可以使用批处理文件,如:
winscp.com /ini=nul /command ^
"open sftp://username:password;fingerprint=hostkeyfingerprint@example.com/" ^
"put -filemask=*>=today ""c:\local\path\*"" ""/remote/path/""" ^
"exit"
>=today
keyword仅受 WinSCP 5.15 及更新版本支持。在旧版本中,您可以使用
%TIMESTAMP%
syntax ,特别是 >=%%TIMESTAMP#yyyy-mm-dd%%
, 而不是 >=today
.您可以拥有 WinSCP GUI generate the batch file template for you ,包括 host key fingerprint part .
引用:
您可以 use the script in SSIS或 schedule it with Windows scheduler .
(我是 WinSCP 的作者)
关于ssis - 将今天的文件从本地目录上传到 SFTP 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41497930/