How to rsync only directories, no files inside ?

Tim Conway conway at
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]} 
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

Steven Shiau <steven at> 
Sent by: at
02/29/2004 11:11 AM
Please respond to

rsync at

How to rsync only directories, no files inside ?

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格式的?案.
Steven Shiau
E-mail: steven _at_; steven _at_
To unsubscribe or change options:
Before posting, read:

More information about the rsync mailing list