ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Gies <olivier.g...@bull.net>
Subject Re: Check process on remote host - Can Ant do that ?
Date Wed, 13 Feb 2008 03:39:41 GMT
Maybe you can implement a condition to be used with Ant's core <waitfor> 
task...

Olivier

-------- Original Message  --------
Subject: Re: Check process on remote host - Can Ant do that ?
From: Z W <mpc8250@gmail.com>
To: Ant Users List <user@ant.apache.org>
Date: 06/02/2008 15:10
> Thanks for responding.
> But how do I make a conditional infinite loop with it ?
> Is there an Ant task for infinite loop ?
>
> ie
> while (1)
> {
>    sshexec_check_remote_process_on_remote_host
>    if (remote_process == dead)
>    break;
>    else
>    sleep 10 mins
> }
>
> On Feb 5, 2008 3:39 PM, Charbel BITAR <bitarch@gmail.com> wrote:
>
>   
>> 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
>>>
>>>       
>
>   

-- 

*Olivier Gies*

*Delivery Manager
Customs & Tax Software Engineering Center
Bull, Architect of an Open World ^TM
Phone: +86 (10) 65978001 - Ext 555 *

*www.bull.com <http://www.bull.com/>*

*This e-mail contains material that is confidential for the sole use of 
the intended recipient. Any review, reliance or distribution by others 
or forwarding without express permission is strictly prohibited. If you 
are not the intended recipient, please contact the sender and delete all 
copies.*


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message