读书人

Ant-sshexec-实施远程服务器或本地脚本

发布时间: 2012-06-29 15:48:46 作者: rapoo

Ant-sshexec-执行远程服务器或本地脚本

1. 远程服务器

?

?

?

Reference:http://ant.apache.org/manual/Tasks/sshexec.html

?

Runs a command on a remote machine running SSH daemon.

Note:<sshexec host="${host}" username="${usr}" password="${pwd}" trust="true" command="pwd;./test.sh" outputproperty="output"/>

?

?

?

这样在后续的ant脚本中就可以用${output}来取得脚本的运行结果了。

?

<exec dir="${tools.dir}" executable="xx.sh或xx.bat或xx.exe" outputproperty="platform.type" />

?

?

<exec dir="${tools.dir}" executable="uname" outputproperty="platform"> <arg value="-s"></arg></exec>

读书人网 >软件开发

热点推荐