Home » Linux Administration, Web Development

How to rsync directory structure but not files

14 August 2011 No Comment

rsync -av --include='*/' --exclude='*' /src/path /destination/path

An example where we use it is when building Magento templates and themes, we copy the directory structure across but not the files so that when we need to, we can copy a file across from the base theme without having to create the directory structure before copying the file:

rsync -av --include='*/' --exclude='*' app/design/frontend/base/default/ app/design/frontend/default/default/

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.