之所以有这篇文章,是看到dreadhead的高效开发的敲门砖之后的一点点实践,对应的是《Productive Programmer》这本书中Automation相关章节。
Winscp的中文网站地址: http://winscp.net/eng/docs/lang:chs
下面的这个小例子主要使用了Winscp的脚本和命令行方式功能,更复杂的同步功能请使用 synchronize 命令。
命令:"c:\Program Files\WinSCP\WinSCP.exe" /console /script=c:\sync.txt
c:\sync.txt的内容
option confirm off
open user:pwd@host1
put c:\test.txt /root/tmp
close
open user:pwd@host2
put c:\test.txt /root/tmp
close
open user:pwd@host3
synchronize remote c:\tmp /root/tmp -delete
close
exit