As you said use the <sshexec> task.
Here's an example :
...
<property name="sshexec.host" value="" />
<property name="sshexec.username" value="" />
<property name="sshexec.password" value="" />
<property name="sshexec.trust" value="" />
<property name="sshexec.failonerror" value="" />
 <property name="sshexec.timeout" value="" />
<property name="sshexec.command" value='ps -ef | cut -d" " -f5 | grep 11875'
/>
...
<target name="sshexec" description="SSHExec">
 <sshexec host="${sshexec.host}" username="${sshexec.username}" password="${
sshexec.password}" trust="${sshexec.trust}" failonerror="${
sshexec.failonerror}" timeout="${sshexec.timeout}" command="${
sshexec.command}" outputproperty="sshexec.outputproperty" />
...Use a condition to check that ${sshexec.outputproperty} !equals the empty
string...
</target>
...

HTH
--
Charbel



On Feb 5, 2008 11:24 PM, Z W <[EMAIL PROTECTED]> wrote:

> Hi
>
> I have an ant script that needs to check the status of a process running
> on
> a remote machine and if the
> process has stopped running, I like the Ant script the ability to know
> that
> and move on to the next step in Ant script.
> Could someone here give a simple example on how to implement that ?
> I have some idea of using sleep to periodically check for a remote process
> but
> is there an Ant task or a workaround that I could implement to check the
> process using ps ?
> I'm not sure sshexec could help me with that.
>
> Thank you all for your helpful tips and comments
>

Reply via email to