HELP: rsync using destination enviorment data

HELP: rsync using destination enviorment data

am 22.10.2007 21:13:10 von RocketMan

K, it took a while but I finally found one part of my solution. To
get this to work
rsync -avx -e ssh ./filename
DestinationHostUserName@DestinationHost:directory

HOWEVER, I do need to know, if its possible, how to get rsync to use
the DestinationHosts definition for an enviorment value called $DATA
which in my case is the directory to put the file into which MAY
change from machine to machine.

HELP PLEASE.

THANKS

Re: HELP: rsync using destination enviorment data

am 22.10.2007 21:59:28 von Bill Marcum

On 2007-10-22, RocketMan wrote:
> K, it took a while but I finally found one part of my solution. To
> get this to work
> rsync -avx -e ssh ./filename
> DestinationHostUserName@DestinationHost:directory
>
> HOWEVER, I do need to know, if its possible, how to get rsync to use
> the DestinationHosts definition for an enviorment value called $DATA
> which in my case is the directory to put the file into which MAY
> change from machine to machine.
>
> HELP PLEASE.
>
> THANKS
>
DATA=$(ssh DestinationHostUserName@DestinationHost ". ~/.bashrc; echo $DATA")
Replace ~/.bashrc with the name of the script that sets DATA.
Or perhaps
ssh DestinationHostUserName@DestinationHost 'rsync -avh -e ssh \
SourceHostUserName@SourceHost:/path/filename $DATA'