ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: flatten mapper for scp task?
Date Wed, 13 Oct 2004 12:30:13 GMT
How about first copying the files to a temporary
directory and then scp'ing to the server and finally
deleting then from tmp:

<mkdir dir="${java.io.tmpdir}/tmpsqls"/>
<copy todir="${java.io.tmpdir}/tmpsqls"
flatten="true">
    <fileset dir="${user.home}/${source.dir}">
        <include name="**/*.sql"/>
    </fileset>
</copy>
<scp
todir="${target.user}@${target.host}:${target.dir}" 
    keyfile="${user.home}/.ssh/id_dsa"
    passphrase="">
    <fileset dir="${java.io.tmpdir}/tmpsqls">
        <include name="**/*.sql"/>
    </fileset>
</scp>
<delete dir="${java.io.tmpdir}/tmpsqls"/>

HTH Ivan


--- Holger Rauch <holger.rauch@heitec.de> wrote:

> Hi!
> 
> I'm using the scp task of Ant 1.6.2 in order to copy
> some SQL scripts
> which are stored in various directories on the
> source system to
> a target system. On the target system, I want all
> .sql files to
> appear below a single directory. How can I achieve
> this if scp
> doesn't support neither
> 
> <flattenmapper />
> 
> nor 
> 
> <mapper type="flatten" /> ?
> 
> Here's what I tried:
> 
> <target name="ssh-multi-flat">
>    <scp
> todir="${target.user}@${target.host}:${target.dir}" 
>         keyfile="${user.home}/.ssh/id_dsa"
>         passphrase="">
>      <fileset dir="${user.home}/${source.dir}">
>        <include name="**/*.sql"/>
>      </fileset>
>      <mapper type="flatten" />
>   </scp>
> </target>
> 
> (I know the "mapper" element is wrong; if I omit it,
> the stuff is copied to
> the target system *including* the subdirs).
> 
> Thanks in advance for any info!
> 
> Kind regards,
> 
> 	Holger
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Mime
View raw message