Reputation: 141
I'm trying to automate a file synchronisation from a local computer to a remote host in java using WinSCP. Can someone help me suggest what would be the command?
//---Javacode
Runtime.getRunTime().exe(cmd /...../);
Upvotes: 0
Views: 780
Reputation: 202292
WinSCP command-line to synchronize file is like:
winscp.com /command ^
"option batch abort" ^
"open sftp://[email protected]" ^
"synchronize d:\www\ ./www/" ^
"exit"
See the guide to WinSCP scripting.
Upvotes: 0
Reputation: 38751
Don't exec(). Use either the ant scp task which will do the same thing as WinSCP, or directly integrate JSCH:
Much simpler.
Upvotes: 2