我正在尝试使用 Unison 同步两个目录,但是如果它遇到一个有错误的文件,那么它会跳过整个目录!我不认为它应该跳过整个目录,而应该只跳过那个文件。我没意见。我如何告诉它忽略错误并继续复制其余文件?
Unison 是 Windows 可执行文件,而不是 Cygwin。我可以用 Cygwin 读取文件。Unison 实际上确实遇到了文件错误,我可以跳过它们。
2.32 版比 2.40 版效果更好。2.40 版甚至无法启动。
我试过添加 -ignore,但这没有帮助。这是我尝试过的:
$ 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-----
命令行参考:
http://www.cis.upenn.edu/~bcpierce/unison/download/releases/stable/unison-manual.html#prefs
我放弃了Unison。我切换到 Synchronize It,它保留了修改时间并且速度提高了 10 倍。但是,它不会以两种方式传播删除。
同步它:http ://www.grigsoft.com/wndsync.htm
另外,关于错误
查看
$HOME/.unison/default.prf
or%HOME%\.unison\default.prf
,检查是否有以 开头的行root=
并删除它们或将它们移动到另一个配置文件。如果还有其他行,您可以查看它们以检查它们是否适合您的情况。(除了一些牵强附会的情况,其中一个人非常确定他们只同步一组目录树,default.prf
应该只包含选项,而不是根规范。)也就是说,您可以创建和使用
.prf
指定要同步的目录树根的配置文件(.unison 目录中的文件)。任何个人资料都可能包括其他人,甚至include default
. 后一种情况可以方便地共享一组您希望应用于所有配置文件的选项,甚至在没有在命令行上指定配置文件的情况下启动 unison 时也是如此。有关详细信息,请参阅Unison 文档 - 配置文件。