我想要制作一个批处理脚本,能够侦听我的 ftp 服务器,并在每次在 ftp 服务器上上传新文件时将文件下载到我的计算机。
有任何想法吗?我用的是WinSCP。
您可以使用WinSCP 脚本 https://winscp.net/eng/docs/scripting以其synchronize command https://winscp.net/eng/docs/scriptcommand_synchronize:
:Loop
winscp.com /command ^
"option batch abort" ^
"open <session>" ^
"synchronize local <local directory> <remote directory>" ^
"exit"
timeout 10
goto :Loop
在 Windows XP 及更早版本上,使用ping -n 10 127.0.0.1
代替timeout 10
.
也可以看看:
- WinSCP FTP 设置持续监控变化和下载 https://stackoverflow.com/q/20372868/850848 and
- WinSCP 文章保持本地目录最新(从远程SFTP/FTP服务器下载更改的文件) https://winscp.net/eng/docs/library_example_keep_local_directory_up_to_date.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)