如何在 Windows 上安排自动 FTP 下载?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21293019/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to schedule an automatic FTP download on Windows?
提问by optionalNickname
I need to connect to a host with username, password, implicit TLS encryption and port number to download files to a folder daily on windows server standard. Is there a third party command-line application that I could download, install and use for this (preferably free)? I'm not absolutely sure if this could be done with Windows ftp
and if it can, could it be done in batch file?
我需要使用用户名、密码、隐式 TLS 加密和端口号连接到主机,才能每天将文件下载到 Windows 服务器标准上的文件夹中。是否有第三方命令行应用程序可供我下载、安装和使用(最好是免费的)?我不确定这是否可以用 Windows 完成,ftp
如果可以,是否可以在批处理文件中完成?
I am trying NcFTP but I'm not sure if it supports encryption either.
我正在尝试 NcFTP,但我不确定它是否也支持加密。
I was given specific credentials, I have no control over the server. I have only instructions on how to access and download the files with FileZilla client over TLS. I need to schedule a routine that does this job for me since I don't want to manually do this every day. I can manage myself on this I only need a tool that could do this job over command-line.
我获得了特定的凭据,我无法控制服务器。我只有关于如何通过 TLS 使用 FileZilla 客户端访问和下载文件的说明。我需要安排一个例程来为我完成这项工作,因为我不想每天手动执行此操作。我可以在这方面管理自己,我只需要一个可以通过命令行完成这项工作的工具。
回答by Martin Prikryl
You can use WinSCP, it supports both scripting and TLS/SSL.
您可以使用 WinSCP,它支持脚本和 TLS/SSL。
See automating file transfers to FTP server.
请参阅自动将文件传输到 FTP 服务器。
A simple batch file to download files over an explicit TLS/SSL (note the ftpes://
) with WinSCP looks like:
ftpes://
使用 WinSCP通过显式 TLS/SSL(注意)下载文件的简单批处理文件如下所示:
winscp.com /log=c:\path\ftp.log /command ^
"open ftpes://user:[email protected]/" ^
"get /home/user/* c:\destination\" ^
"exit"
You can have the batch file generated by WinSCP GUIfor you.
您可以让WinSCP GUI为您生成批处理文件。
For scheduling, simply use the Windows Scheduler.
For details see scheduling file transfers to FTP server.
对于调度,只需使用 Windows 调度程序。
有关详细信息,请参阅计划文件传输到 FTP 服务器。
(I'm the author of WinSCP)
(我是 WinSCP 的作者)
Similarly for an upload: Schedule an automatic FTP upload on Windows with WinSCP
回答by mihai_mandis
You can use sftp to get files. But you need to have an SSH server installed on remote host (OpenSSH is free).
您可以使用 sftp 来获取文件。但是你需要在远程主机上安装一个 SSH 服务器(OpenSSH 是免费的)。
Then you can use putty tools (free) psftp.exe or pscp.exe to upload/download files in encripted format.
然后您可以使用腻子工具(免费)psftp.exe 或 pscp.exe 以加密格式上传/下载文件。
Link for putty tools download: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.htmlLink for OpenSSH download: http://www.openssh.com/
链接腻子工具下载:http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html上链接的OpenSSH下载:http://www.openssh.com/