开发者

How to execute UNIX command from Windows XP system using ANT

开发者 https://www.devze.com 2023-01-06 08:21 出处:网络
I want to execute a UNIX command from my local Windows XP system using ANT script. UNIX system is a remote server.

I want to execute a UNIX command from my local Windows XP system using ANT script. UNIX system is a remote server.

I have tried the following:

  <target name="execute" >
    <sshexec host="host IP" 
    username="uname" 
    password="pass" 
    commandResource="sh abc.sh"/>
  </target>

but got the error below:

 BUILD FAILED
 ..\build.xml:49: com.jcraft.jsch.JSchException:     con开发者_运维技巧nection is closed by foreign
 host


take a look at the sshexec ant task. You will need a jsch library on the ant classpath and the UNIX server needs to be running a ssh daemon.

0

精彩评论

暂无评论...
验证码 换一张
取 消