Eu não encontrei usando -p
coisas fixas. Em vez disso, criei manualmente as versões vazias dos diretórios do problema e, em seguida, o rsynced.
Estou rsynced conteúdo da minha caixa do Windows XP para uma caixa do OS X Lion, e algumas das pastas têm a permissão errada.
> rsync -rtvz --del "/cygdrive/c/rsync_20101220/" "agrimm@[redacted]:'/Users/agrimm/external/daiichi/Top level files/rsync_20101220'"
[lot of listing of files skipped. More logging than buffer, so I don't know if any logging messages were lost]
sent 2439672264 bytes received 1444272 bytes 795800.01 bytes/sec
total size is 22869261932 speedup is 9.37
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1042) [sender=3.0.7]
Na caixa do OS X, é isso que eu obtenho com permissão:
~ agrimm$ cd external/daiichi/
daiichi agrimm$ ls -ltra
total 0
drwxr-xr-x 6 agrimm staff 204 Aug 24 2011 Thunderbird
drwxr-xr-x 6 agrimm staff 204 Jul 4 09:21 FinePrint files
drwxr-xr-x 4 agrimm staff 136 Jul 10 13:10 ..
drwxr-xr-x 17 agrimm staff 578 Jul 11 10:50 Desktop
drwxr-xr-x 6 agrimm staff 204 Jul 11 11:22 .
drwxr-xr-x 3 agrimm staff 102 Jul 11 11:25 Top level files
daiichi agrimm$ cd Top\ level\ files/
Top level files agrimm$ ls -ltra
total 0
drwxr-xr-x 5 agrimm staff 170 Aug 18 2011 rsync_20101220
drwxr-xr-x 6 agrimm staff 204 Jul 11 11:22 ..
drwxr-xr-x 3 agrimm staff 102 Jul 11 11:25 .
Top level files agrimm$ cd rsync_20101220/
rsync_20101220 agrimm$ ls -ltra
total 0
d-wx------ 4 agrimm staff 136 Dec 4 2009 Desktop
d-wx------ 13 agrimm staff 442 Apr 5 2011 gitrepos
drwxr-xr-x 5 agrimm staff 170 Aug 18 2011 .
drwx------ 7 agrimm staff 238 Aug 18 2011 code
drwxr-xr-x 3 agrimm staff 102 Jul 11 11:25 ..
rsync_20101220 agrimm$ ls Desktop/
ls: : Permission denied
rsync_20101220 agrimm$ ls gitrepos/
ls: : Permission denied
rsync_20101220 agrimm$ ls -ltr code/
total 0
d-wx------ 3 agrimm staff 102 Jan 20 2010 temporary_development
d-wx------ 3 agrimm staff 102 Dec 2 2010 merging
d-wx------ 3 agrimm staff 102 Dec 21 2010 inactive
d-wx------ 5 agrimm staff 170 Jul 4 2011 sandbox
d-wx------ 19 agrimm staff 646 Aug 24 2011 hiv_recombination
rsync_20101220 agrimm$ ls -R code/
hiv_recombination inactive merging sandbox temporary_development
code//hiv_recombination:
ls: hiv_recombination: Permission denied
code//inactive:
ls: inactive: Permission denied
code//merging:
ls: merging: Permission denied
code//sandbox:
ls: sandbox: Permission denied
code//temporary_development:
ls: temporary_development: Permission denied
rsync_20101220 agrimm$
As permissões e os usuários dos arquivos parecem consistentes na caixa do Windows. De dentro do git bash:
A.Grimm@AGRIMM-MED /c/rsync_20101220
$ ls -ltra
total 0
drwxr-xr-x 2 A.Grimm Administ 0 Dec 4 2009 Desktop
drwxr-xr-x 13 A.Grimm Administ 0 Apr 5 2011 gitrepos
drwxr-xr-x 5 A.Grimm Administ 0 Aug 18 2011 .
drwxr-xr-x 7 A.Grimm Administ 0 Aug 18 2011 code
drwxr-xr-x 26 A.Grimm Administ 0 Jul 11 12:55 ..
Por que as permissões estão erradas em algumas circunstâncias, mas não em outras? Devo apenas excluir "rsync_20101220" na caixa OS X e fazê-lo novamente com -p adicionado ao comando rsync?