简体   繁体   English

将批处理文件中的新文件从FTP服务器下载到Windows

[英]Downloading new files from FTP server to Windows in a batch file

I am writing a batch file that downloads files from an FTP server. 我正在编写一个从FTP服务器下载文件的批处理文件。

Now, I want these files to be checked against the existing files, so that they are not being downloaded again. 现在,我希望对照现有文件检查这些文件,以免再次下载它们。 There are multiple files being downloaded and I do not know the name of the files that may be present in the FTP server. 有多个文件正在下载,我不知道FTP服务器中可能存在的文件名。

Thanks 谢谢

Just use any Window command-line FTP client that supports synchronization. 只需使用任何支持同步的Window命令行FTP客户端即可。

For example with WinSCP FTP client , you can use a batch file like: 例如,对于WinSCP FTP client ,您可以使用类似以下的批处理文件:

@echo off
winscp.com /ini=nul /log=synchronize.log /command ^
    "open ftp://username:password@ftp.example.com/" ^
    "synchronize local C:\local\path /remote/path" ^
    "exit"

References: 参考文献:

You can have WinSCP GUI generate a batch file template for you . 您可以让WinSCP GUI 为您生成一个批处理文件模板

(I'm the author of WinSCP) (我是WinSCP的作者)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM