[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

THANK YOU! - was [Re: Duplicating a partition's directory structure - How?]



On 1/3/2017 5:28 AM, Sven Joachim wrote:
On 2017-01-03 05:13 -0600, Richard Owlett wrote:

I wish to duplicate a partition's directory structure without any of
the existing file contents. The immediate application is a heavily
customized version of an installation DVD. There are two underlying
goals. I wish to reuse some existing utilities which expect to find
data in a particular branch of the directory tree. The second is very
similar in that a person familiar with a structure would assume that
certain types of information will be in a particular sub-directory.

Also this will be an educational experience as I expect the answer
will be elegant in its simplicity and point me towards chasms in my
understanding of Linux.

Found this solution on [1], it seems to work.

$ rsync -a -f"+ */" -f"- *" source/ destination/

Cheers,
        Sven


1. http://psung.blogspot.com/2008/05/copying-directory-trees-with-rsync.html


That link was particularly valuable for its description of the scope of things that can be accomplished with "filter rules". Reading the man page for rsync is more productive for the perspective that blog post triggered.

Not only do I have an answer to my specific question but pointers to ideas that will simplify achieving my overall goals.



Reply to: