Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to synchronize two directories using Unison, however if it encounters a file with an error, then it skips the entire directory! I don't believe it should skip the whole directory, and instead should just skip that file. I'm OK with that. How do I tell it to ignore the error and continue to copy the rest of the files?

The Unison is a Windows executable, not Cygwin. I can read the file with Cygwin. Unison does in fact encounter an error on the file, and I'm OK with skipping them.

Version 2.32 works better than 2.40. Version 2.40 won't even start.

I've tried adding -ignore, but that doesn't help. Here is what I tried:

$ unison 'c:\cygwin' 'socket://xps:4321/c:/cygwin'
UNISON 2.32.52 started propagating changes at 02:53:35 on 27 Feb 2013
[ERROR] Skipping etc
  [root 1]: Error in digesting c:/cygwin/etc/ssh_host_dsa_key:
c:/cygwin/etc/ssh_host_dsa_key: Permission denied
[ERROR] Skipping home
  [root 1]: Error in digesting c:/cygwin/home/SYSTEM/.bash_history:
c:/cygwin/home/SYSTEM/.bash_history: Permission denied
...
Saving synchronizer state
Synchronization complete at 02:53:39  (3 items transferred, 2 skipped, 0 failed)
  skipped: etc
  skipped: home




$ unison 'c:\cygwin' 'socket://xps:4321/c:/cygwin' -ignore 'Path etc\ssh_host_dsa_key' -ignore 'Path home\SYSTEM\.bash_history'
Contacting server...
Connected [//dumbopc/c:/cygwin -> //xps/c:/cygwin]
Looking for changes
  Waiting for changes from server
Reconciling changes
local          xps
         error            etc
[root 1]: Error in digesting c:/cygwin/etc/ssh_host_dsa_key:
c:/cygwin/etc/ssh_host_dsa_key: Permission denied
         error            home
[root 1]: Error in digesting c:/cygwin/home/SYSTEM/.bash_history:
c:/cygwin/home/SYSTEM/.bash_history: Permission denied
...
Proceed with propagating updates? [] g
Propagating updates    
UNISON 2.32.52 started propagating changes at 04:11:26 on 27 Feb 2013
[ERROR] Skipping etc
  [root 1]: Error in digesting c:/cygwin/etc/ssh_host_dsa_key:
c:/cygwin/etc/ssh_host_dsa_key: Permission denied
[ERROR] Skipping home
  [root 1]: Error in digesting c:/cygwin/home/SYSTEM/.bash_history:
c:/cygwin/home/SYSTEM/.bash_history: Permission denied
...
UNISON 2.32.52 finished propagating changes at 04:11:28 on 27 Feb 2013
Saving synchronizer state
Synchronization complete at 04:11:30  (6 items transferred, 2 skipped, 0 failed)
  skipped: etc
  skipped: home



# Version 2.40
C:\Program Files\Unison>"Unison-2.40.102 Text.exe"  'c:\cygwin' 'socket://xps:4321/c:\cygwin'
Contacting server...
Fatal error: Wrong number of roots: 2 expected, but 4 provided ('c:\cygwin', 'socket://xps:4321/c:\cygwin', , )
(Maybe you specified roots both on the command line and in the profile?)


@REM DOS
C:\cygwin\etc>type ssh_host_dsa_key
Access is denied.

# Cygwin
$ ls -l /etc/ssh_host_dsa_key
-rw------- 1 SYSTEM None 668 Aug 30  2010 /etc/ssh_host_dsa_key

$ cat /etc/ssh_host_dsa_key
-----BEGIN DSA PRIVATE KEY-----

Command line reference:

http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#prefs

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I gave up on Unison. I switched to Synchronize It, which preserves modification times and is 10x faster. However, it doesn't propagate deletes both ways.

Synchronize It: http://www.grigsoft.com/wndsync.htm

Also, regarding the error

Wrong number of roots: 2 expected, but 4 provided

Look at $HOME/.unison/default.pref or %HOME%.unison\default.pref and check if root= is empty. Delete the file if so. Unison is dumb.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.