É cp -au / cp --archive --update contradictory?

1

Desejo atualizar um diretório em um disco de backup com novo conteúdo adicionado à origem e, é claro, rsync é muito lento . cp -a faz o truque, mas é um trator; cp -u deve deixar os arquivos existentes sozinhos. No entanto, se eu inspecionar o que eles estão fazendo juntos (cp -auv), vejo muitos arquivos sendo copiados para o diretório que a AFAIK já estava lá.

Olhando para o manual do CP , as duas opções não parecem contradição. Então, eu provavelmente estou errado e o CP está fazendo a coisa certa. Alguns trabalhos em excesso não importam muito, porque o CP é tão rápido.

Ou talvez eles sejam contraditórios na prática, porque há sempre uma pequena diferença entre os padrões entre a origem e o destino? Eu não seria o primeiro confuso com -u .

‘--archive’
Preserve as much as possible of the structure and attributes of the original files in the copy (but do not attempt to preserve internal directory structure; i.e., ‘ls -U’ may list the entries in a copied directory in a different order). Try to preserve SELinux security context and extended attributes (xattr), but ignore any failure to do that and print no corresponding diagnostic. Equivalent to -dR --preserve=all with the reduced diagnostics. 
‘--update’
Do not copy a non-directory that has an existing destination with the same or newer modification time. If time stamps are being preserved, the comparison is to the source time stamp truncated to the resolutions of the destination file system and of the system calls used to update time stamps; this avoids duplicate work if several ‘cp -pu’ commands are executed with the same source and destination. If --preserve=links is also specified (like with ‘cp -au’ for example), that will take precedence. Consequently, depending on the order that files are processed from the source, newer files in the destination may be replaced, to mirror hard links in the source.
    
por Nemo 02.11.2014 / 20:02

0 respostas