ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Using environment variable in SCP
Date Tue, 18 Mar 2008 06:46:14 GMT
When working with remote tasks like <scp> we have to distinguish
between two environments: the env from the local and the remote machine.

You can use the local environment by loading them into properties.
    <property environment="env"/>
    <scp remoteTodir="${remote.user}:${remote.password}@${host}:${env.SOLR_HOME}/">

I dont think that you can use the remote environment.
What you could do as workaround is
    1. <scp> to a tmp directory
    2. <sshexec> to move the files
Because the <sshexec> works on the remote machine you should have access the the 
remote environment variables.


> -----Ursprüngliche Nachricht-----
> Von: Suhas Majale [] 
> Gesendet: Dienstag, 18. März 2008 07:08
> An:
> Betreff: Using environment variable in SCP
> HI all,
> I am very new to ant and am using the SCP to transfer files 
> from windows to
> linux (FC 6) machine.
> Following is the code,
> *<scp remoteTodir="${remote.user}:${remote.password}@${host}:${
> solr.home.path}/" trust="true" sftp="true">*
> *<fileset dir="solr"/>
> </scp>**
> *
> The *solr.home.path* is getting read from the associated 
> properties file.
> When I assign absolute path for solr.home.path the transfer works
> successfully.
> i.e *solr.home.path=/root/solr-deploy/solr*
> Now instead of giving the absolute path, I tried giving 
> environment variable
> that is set for that path. When I do so, the transfer fails.
> *solr.home.path=$SOLR_HOME*
> Can we use environment variable in SCP ? If yes, what is the 
> way we do it?
> Regards, Suhas M

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message