Rsync: Only preserve meta (time, group, etc) on files and sub-directories, not root directory

Posted by Svish on Super User See other posts from Super User or by Svish
Published on 2010-04-05T17:55:43Z Indexed on 2010/04/05 18:03 UTC
Read the original article Hit count: 396

Filed under:
|
|

I am copying some files (all except hidden ones) using rsync from one place to another using this command:

rsync -Cav --delete --exclude=.* /Some/Directory/ other-host:/Other/Directory

It works nice except that I get the following errors:

rsync: chgrp "/Other/Directory/." failed: Operation not permitted (1)
rsync: failed to set times on "/Other/Directory/.": Permission denied (13)

That is understandable because I do in fact not have those permissions, and I also do not want to change the group of that directory. I only want to do this for all the files and directories that are in that directory. Is there any way to solve this? Tried to --exclude=. and --exclude=./, but those didn't work.

Any ideas? I have no idea how to fix this...


More details: This is on Mac OS X, and the directories I am syncing is from a local mounted volume to the /Users/Shared/ directory on the other host. That directory has user root and group wheel. The files inside it has user admin and group staff and so does the local source directory.

© Super User or respective owner

Related posts about mac

Related posts about unix