Jump to content

Unison non-recursive synchronization: how?


theYinYeti
 Share

Recommended Posts

Hello,

 

I want to use Unison in batch mode for a given path without recursivity. What I have so far does not work.

 

Here's my test config:

$ find /home/yves/test
/home/yves/test/
/home/yves/test/client
/home/yves/test/client/var
/home/yves/test/client/var/unison
/home/yves/test/client/var/unison/default.prf
/home/yves/test/client/var/unison/backup
/home/yves/test/client/share
/home/yves/test/client/share/rep
/home/yves/test/server
/home/yves/test/server/share
/home/yves/test/server/share/rep

$ cat /home/yves/test/client/var/unison/default.prf
sortbysize = true
group = true
owner = true
times = true
perms = -1

 

I then synchronize client/share and server/share:

$ UNISON=/home/yves/test/client/var/unison \
 unison default /home/yves/test/client/share ssh://yves@localhost//home/yves/test/server/share \
 -ui text -dumbtty \
 -backupdir /home/yves/test/client/var/unison/backup \
 -logfile /home/yves/test/client/var/unison/log \
 -sshargs -x

 

From there, I create a file in the client's "rep", and a non-empty sub-directory in the server's "rep", and I try and synchronize both non-recursively using the path and ignore parameters:

$ touch /home/yves/test/client/share/rep/repfic
$ mkdir /home/yves/test/server/share/rep/reprep
$ touch /home/yves/test/server/share/rep/reprep/reprepfic
$ UNISON=/home/yves/test/client/var/unison \
 unison default /home/yves/test/client/share ssh://yves@localhost//home/yves/test/server/share \
 -ui text -dumbtty -auto -contactquietly -silent -batch -terse \
 -backupdir /home/yves/test/client/var/unison/backup \
 -logfile /home/yves/test/client/var/unison/log \
 -sshargs -x -path "Path rep" -ignore "Path rep/*/*"

 

I expected rep/repfic to go to the server, and rep/reprep (but not rep/reprep/reprepfic) to go to the client. Instead, nothing happens. Do you understand why?

 

Yves.

 

//EDIT

Out of curiosity, I looked at my /home/yves/test/client/var/unison/log file, and Surprise! here's the content:

UNISON started propagating changes at 19:40:40 on 26 Feb 2008
[BGN] Copying rep/repfic
 from /home/yves/test/client/share
 to //localhost//home/yves/test/server/share
[BGN] Copying rep/reprep
 from //localhost//home/yves/test/server/share
 to /home/yves/test/client/share
[END] Copying rep/reprep
[END] Copying rep/repfic
UNISON finished propagating changes at 19:40:40 on 26 Feb 2008


Synchronization complete  (2 items transferred, 0 skipped, 0 failures)

 

This is what I expect! Why is the result different?

 

//EDIT 2

I tried the newer version 2.27.57 from source. Now there's not even a log file to agree with me :(

Once the -auto -contactquietly -silent -batch -terse options are removed, the software just says:

Nothing to do: replicas have not changed since last sync.

Edited by theYinYeti
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...