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

Stefan Nowak p.org at gmx.at
Mon Mar 9 00:00:17 GMT 2009


Hello everyone!

FOREWORD:

I respect your time and resources, I hope to not bother people on this  
mailinglist!
To my defense: This question is far easier towards humans than to  
mailinglist and web search-engines as the search terms in relation to  
each other are highly in-causal or paradoxical, and hence lead to poor  
results. Of course the manpage was the first place where I looked  
(without success). May other people find the solution to their problem  
in this my post and its replies! Please CC me in your answers, as I am  
not a regular mailinglist subscriber. Thanks!

QUESTION:

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!

Now, for my particular purpose, I want all this behaviour, except that  
directories are not updated with metadata (particularly the date time  
stamps). I tried using --exclude="*/" but this results in that the  
directories AND their entire recursive content are excluded, hence not  
useful for my intention!

MY PARTICLUAR APPLICATION OF RSYNC

I work in media design.
I have a big external hard disk, where I keep my entire content (video  
files).
I have a smaller laptop hard disk, to where I copy the content, which  
I currently need, from my external disk and occasionally fresh content  
from other sources (digital video camera, colleagues, friends,  
webclips).
I keep the same root directory structure on both disks strictly, just  
the files and subdirectories differ.

Hence my sync from source (laptop) to target (external disk) is  
complementary (incremental) and not in clone mode, which would also  
involve --delete on the target, to make it identical to source. I want  
to avoid this, as the source (laptop) is only a selection of the total  
content on external disk (target) plus occasionally fresh content.

By this method, the big disk, always contains everything, and the  
laptop disk only the currently needed and the fresh content.

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/

WHICH RESULTS IN THIS (shortened exemplary list)

[sender] hiding various files matching my filters
.d..t......n Effects/ ## Due to various manual additions/deletions the  
folders' time stamps are different
.d..t......n Nature/
.d..t......n People/
.f........x. Effects/Pixels up down.mov ## Changed the file's Finder  
color label.
 >f++++++++++ Nature/Sunset in Kampala.mov ## Added new file to laptop  
from a colleague.

WHAT I WOULD LIKE

Is that the directories' metadata is not updated. Except of course  
freshly created directories from source shall be created identical on  
target, and hence also their metadata. Everything else in this example  
is perfect!

Friendly greetings to you rSyncers,

Stefan Nowak


More information about the rsync mailing list