我正在嘗試使用 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
答案1
我相信你必須使用2.40版本。我相信 2.40 版會給出錯誤,因為 default.pref 不為空。刪除 %HOME%.unison\default.pref 或 $HOME/.unison/default.pref。您還必須使用 --times 明確告訴它保留修改時間。