How to rsync directory structure but not files

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/

Published by salubrium

I am a Systems Administrator based in Sydney, Australia with some hugely varied interests: Topics covered are Virtualization, Web Hosting, Remote Desktop, Security and Backups, PHP, Python, MVC Frameworks, SEO

Leave a comment

Your email address will not be published. Required fields are marked *