How to exclude directories from getting their metadata updated? (Macintosh HFS+ with rsync 3.0.5)

Matt McCutchen matt at mattmccutchen.net
Mon Mar 9 00:48:10 GMT 2009


On Mon, 2009-03-09 at 01:00 +0100, Stefan Nowak wrote:
> I am doing a recursive sync on a Macintosh, hence HFS+ filesystem,  
> with rsync 3.0.5 installed through MacPorts. I am amazed of rsync's  
> metadata capability! Let me tell you everything works amazingly  
> perfect! When I change i.e. the Finder color labels, and sync that  
> file, rsync successfully only transfers the delta, hence the metadata  
> only! Very effective!

I'm glad to hear it.  That's a result of Mac OS 10.4+ exposing all that
metadata as POSIX-style xattrs and the improvements made to rsync's
xattr support to handle such large xattrs efficiently.

> Now, for my particular purpose, I want all this behaviour, except that  
> directories are not updated with metadata (particularly the date time  
> stamps).

I don't see what's harmful about copying the directory metadata.  But if
you dislike it, you can disable copying of the modification times with
--omit-dir-times.  That option doesn't currently affect creation times;
maybe it should.  To disable copying of permissions and user/group
ownership, you could use the stronger --omit-dir-changes provided by the
maintained patch omit-dir-changes.diff.

> I USED THIS CODE
> 
> /opt/local/bin/rsync \
> --rsync-path="/opt/local/bin/rsync" \
> --protect-args \
> \
> --archive \
> --crtimes \
> --hard-links \
> --acls \
> --xattrs \
> --fileflags \
> \
> --exclude=".*" \
> --exclude="Icon*" \
> \
> --verbose --verbose \
> --itemize-changes \
> --stats \
> --progress \
> \
> --dry-run \
> \
> ~/Movies/VideosPartially/ \
> /Volumes/VideoAll/

BTW, --rsync-path serves no purpose on a local copy.

-- 
Matt



More information about the rsync mailing list