[英]Command for syncing a file from local computer to a remote server in Java - WinSCP
I'm trying to automate a file synchronisation from a local computer to a remote host in java using WinSCP. 我正在尝试使用WinSCP自动化从本地计算机到Java中的远程主机的文件同步。 Can someone help me suggest what would be the command?
有人可以帮我建议命令是什么?
//---Javacode
Runtime.getRunTime().exe(cmd /...../);
Don't exec(). 不要exec()。 Use either the ant scp task which will do the same thing as WinSCP, or directly integrate JSCH:
使用与WinSCP执行相同操作的ant scp任务,或直接集成JSCH:
http://www.jcraft.com/jsch/ http://www.jcraft.com/jsch/
Much simpler. 更简单。
WinSCP command-line to synchronize file is like: 用于同步文件的WinSCP命令行如下:
winscp.com /command ^
"option batch abort" ^
"open sftp://username@example.com" ^
"synchronize d:\www\ ./www/" ^
"exit"
See the guide to WinSCP scripting . 请参阅WinSCP脚本编制指南 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.