You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Rao Chaudhri <rc...@1fbusa.com> on 2010/07/27 22:40:41 UTC

in ANT 1.8

Hi, 

 

I am trying to run a shell "test" command on a remote server, to check for the existence of a file, using <sshsession> task which is available in ANT 1.8.

 

Getting error: "CreateProcess: test -f /tmp/test.log error=2"

Here's the code, not sure what's wrong here.

                  <sshsession                   

                        host="abc123"

                        username="admin"

                        password="admin"                    

                        trust="true"            

                        failonerror="true">                      

                        <sequential>

                              <exec executable="test">                                                                        

                                    <arg line="-f"/>

                                    <arg line="/tmp/test.log"/>

                              </exec>     

                        </sequential>                       

                  </sshsession>                       

 

Thanks in advance.

Usman Chaudhri

 


RE: in ANT 1.8

Posted by Rao Chaudhri <rc...@1fbusa.com>.
I have a list of files which I want to check whether they exist on the remote machine or not. I could use <sshexe>, which will create a new ssh session for each file, which I want to check if it exists on the remote machine. I was wondering if somehow I can just use <sshsession> - which will create an ssh session - and then through that same session I can verify existance of multiple files on the remote machine.

Thanks
Usman Chaudhri

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Wednesday, July 28, 2010 3:50 AM
To: user@ant.apache.org
Subject: Re: <sshsession> in ANT 1.8

On 2010-07-27, Rao Chaudhri wrote:

> Getting error: "CreateProcess: test -f /tmp/test.log error=2"

This is the error Windows emits if it cannot find the executable you ask
it to run.

> Here's the code, not sure what's wrong here.

>                   <sshsession ...
>                         failonerror="true">
>                         <sequential>
>                               <exec executable="test">

If you intend to run the command on the remote machine, you want to use
sshexec, not exec.

Stefan

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




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


RE: in ANT 1.8

Posted by Rao Chaudhri <rc...@1fbusa.com>.
Ant task <sshexec> would create a new session every time.

I want to run "test -f" UNIX command for multiple files on my remote server, and I thought that using <sshsession>, I could just create one SSH session and execute all the UNIX test commands through that same session. This way I can avoid creating multiple SSH sessions to the remote machine. Any ideas?


Thanks
Usman Chaudhri
415-591-3031

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Wednesday, July 28, 2010 3:50 AM
To: user@ant.apache.org
Subject: Re: <sshsession> in ANT 1.8

On 2010-07-27, Rao Chaudhri wrote:

> Getting error: "CreateProcess: test -f /tmp/test.log error=2"

This is the error Windows emits if it cannot find the executable you ask
it to run.

> Here's the code, not sure what's wrong here.

>                   <sshsession ...
>                         failonerror="true">
>                         <sequential>
>                               <exec executable="test">

If you intend to run the command on the remote machine, you want to use
sshexec, not exec.

Stefan

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




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


Re: in ANT 1.8

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-07-27, Rao Chaudhri wrote:

> Getting error: "CreateProcess: test -f /tmp/test.log error=2"

This is the error Windows emits if it cannot find the executable you ask
it to run.

> Here's the code, not sure what's wrong here.

>                   <sshsession ...
>                         failonerror="true">
>                         <sequential>
>                               <exec executable="test">

If you intend to run the command on the remote machine, you want to use
sshexec, not exec.

Stefan

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