Stefan Nowak
2009-Mar-09 00:23 UTC
How to exclude directories from getting their metadata updated? (Macintosh HFS+ with rsync 3.0.5)
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
Matt McCutchen
2009-Mar-09 00:48 UTC
How to exclude directories from getting their metadata updated? (Macintosh HFS+ with rsync 3.0.5)
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
Reasonably Related Threads
- 3.0.8 OSX build hfs+ patch failing
- DO NOT REPLY [Bug 7685] New: rsync should not set the creation data on the root folder of an HFS+ volume
- OSX and HFS+ filesystem compression
- rsync and hfs+ compressed files damaged
- Macintosh rsync: Inconsistent Behaviour: Hints Appreciated