You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Euan Guttridge <EG...@buildonline.com> on 2005/04/06 13:25:41 UTC

rsync wildcard

Hi

Can anyone advise why the following works on the command line, but not
within an ant script. The error is 'file/directory does not exist', when it
clearly does. If I change the *.gz to a specific file it works fine.

Thanks


<exec executable="rsync">
<arg line="-cvz -e 'ssh -i /home/build/sync-key'  /home/build/dist/*.gz
tomcat@10.1.2.3:/home/tomcat"/>
</exec>

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


Re: rsync wildcard

Posted by fr...@CoreTrek.no.
If you want shell expansion, you could probably exec "sh" and use 
<arg line="-c 'echo *.gz'" />

On Wed, Apr 06, 2005 at 15:42:21 +0300, Daniel Blaukopf wrote:
> Looks like Ant doesn't do the expansion that the shell does. This is OK
> - I don't think it is supposed to. You can use the "apply" task and
> specify the *.gz files as a fileset:
> 
> <apply executable="rsync" parallel="true" skipemptyfilesets="true">
>    <arg line="-cvz -e"/>
>    <arg value="ssh -i /home/build/sync-key"/>
>    <srcfile/>
>    <arg value="tomcat@10.1.2.3:/home/tomcat"/>
>    <fileset dir="/home/build/dist" includes="*.gz"/>
> </apply>
> 
> - Daniel
> 
> Euan Guttridge wrote:
> 
> >Hi
> >
> >Can anyone advise why the following works on the command line, but not
> >within an ant script. The error is 'file/directory does not exist', when it
> >clearly does. If I change the *.gz to a specific file it works fine.
> >
> >Thanks
> >
> >
> ><exec executable="rsync">
> ><arg line="-cvz -e 'ssh -i /home/build/sync-key'  /home/build/dist/*.gz
> >tomcat@10.1.2.3:/home/tomcat"/>
> ></exec>


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


Re: rsync wildcard

Posted by Daniel Blaukopf <da...@sun.com>.
Looks like Ant doesn't do the expansion that the shell does. This is OK
- I don't think it is supposed to. You can use the "apply" task and
specify the *.gz files as a fileset:

<apply executable="rsync" parallel="true" skipemptyfilesets="true">
    <arg line="-cvz -e"/>
    <arg value="ssh -i /home/build/sync-key"/>
    <srcfile/>
    <arg value="tomcat@10.1.2.3:/home/tomcat"/>
    <fileset dir="/home/build/dist" includes="*.gz"/>
</apply>

- Daniel

Euan Guttridge wrote:

>Hi
>
>Can anyone advise why the following works on the command line, but not
>within an ant script. The error is 'file/directory does not exist', when it
>clearly does. If I change the *.gz to a specific file it works fine.
>
>Thanks
>
>
><exec executable="rsync">
><arg line="-cvz -e 'ssh -i /home/build/sync-key'  /home/build/dist/*.gz
>tomcat@10.1.2.3:/home/tomcat"/>
></exec>
>
>---------------------------------------------------------------------
>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