ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charbel BITAR" <bita...@gmail.com>
Subject Re: Check process on remote host - Can Ant do that ?
Date Tue, 05 Feb 2008 23:39:23 GMT
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 <mpc8250@gmail.com> 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
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message