0

We want to synchronize a directory, called docs between two hosts, called server and laptop, using unison. So we have a unison profile docs.prf that defines the roots and gives a list of preferred rules for the synchronization. The command unison is always run on laptop. The problem is that sometimes the synchronization is done through a local network, in this case server has an IP like 10.xxx.xxx.xxx and server is identified as server.localdomain, but sometimes it is done over internet, and the IP of server is something like 135.xxx.xxx.xxx and server is known as server.domain.com.

Of course we want to use the same data ar... in both cases and the same rules defined in docs.prf, so creating a second profile is not a solution. I tried to use unison command-line options, to change the remote host name (like -rootalias, -host) , but nothing succeeded. Does anyone have any idea ?

1 Answer 1

1

I found a way out using a script. It first pings server.localdomain. If there is an answer, we are in the private network, default configuration, so it functions as usual. If the ping fails, the script creates a temporary file /tmp/sshRedirect containing

Host     server.localdomain
HostName server.domain.com

and unison is called with the options -sshargs -FsshRedirect (it's important that there is no space after F). This way, unison is transparently redirected.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .