How to schedule an automatic FTP download on Windo

2020-02-26 13:10发布

问题:

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?

I am trying NcFTP but I'm not sure if it supports encryption either.


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.

回答1:

You can use WinSCP, it supports both scripting and TLS/SSL.

See automating file transfers to FTP server.

A simple batch file to download files over an explicit TLS/SSL (note the ftpes://) with WinSCP looks like:

winscp.com /log=c:\path\ftp.log /command ^
    "open ftpes://user:password@example.com/" ^
    "get /home/user/* c:\destination\" ^
    "exit"

You can have the batch file generated by WinSCP GUI for you.


For scheduling, simply use the Windows Scheduler.
For details see scheduling file transfers to FTP server.

(I'm the author of WinSCP)



回答2:

You can use sftp to get files. But you need to have an SSH server installed on remote host (OpenSSH is free).

Then you can use putty tools (free) psftp.exe or pscp.exe to upload/download files in encripted format.

Link for putty tools download: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html Link for OpenSSH download: http://www.openssh.com/