How to rsync only directories, no files inside ?

Tim Conway conway at us.ibm.com
Mon Mar 1 17:13:39 GMT 2004


Rsync doesn't have a "-type" qualifier, but as I understand it, it now 
includes a "--files-from=" option.
find {path[s]} -type d -print |rsync --perms --owner --group --times 
--links --files-from=- {path[s]} {destinationhost}:
Actually, I've just learned that --files-from turns off --recursive in 
--archive, so
find {path[s]} -type d -print |rsync -a --files-from=- {path[s]} 
destinationhost:
Or, if you're putting them in a different place
(cd {rootpath}; find {path[s]} -type d -print) |rsync -a --files-from=- 
{rootpath} {destinationhost}:{destinationpath}

Incidentally, kudos to whoever's doing the man pages now.  This feature 
was suggested but unimplemented last time I used rsync, and now it's 
clearly explained, in detail, with useful examples.

Tim Conway
AIX System Administration
Contractor - IBM Global Services
conway at us.ibm.com




Steven Shiau <steven at nchc.org.tw> 
Sent by: rsync-bounces+conway=us.ibm.com at lists.samba.org
02/29/2004 11:11 AM
Please respond to
steven


To
rsync at lists.samba.org
cc

Subject
How to rsync only directories, no files inside ?






Hi.
I need to create a lot of directories, just the same with remote's /var,
but I only need the directories, the files inside those sub-directories in
/var/ are not necessary for me.
I know "find+cp" can do, but I would like to use the archive mode, i.e. I
need the original permision, owner, group...
Can I make it using rsync ? If so, please tell me how.
Thank you in advance.
-- 
Please AVOID distributing documents in WORD, EXCEL or POWERPOINT format.
[Chinese Big5] 請避免散佈WORD, EXCEL 或是 POWERPOINT格式的?案.
See http://www.fsf.org/philosophy/no-word-attachments.html
and http://www.cyut.edu.tw/~ckhung/published/997nodoc.shtml
----------------------------------
Steven Shiau
E-mail: steven _at_ nchc.org.tw; steven _at_ stick.idv.tw
-- 
To unsubscribe or change options: 
http://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html



More information about the rsync mailing list