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}:[EMAIL PROTECTED]:${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.
Jan
> -----Ursprüngliche Nachricht-----
> Von: Suhas Majale [mailto:[EMAIL PROTECTED]
> Gesendet: Dienstag, 18. März 2008 07:08
> An: [email protected]
> 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}:[EMAIL PROTECTED]:${
> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]