how to mirror only selected directories?

Moe, Mark at
Tue Aug 30 16:15:05 GMT 2005

Thanks Wayne and Aaron, I'll use a combo of find/rsync as suggested.

- Mark 

-----Original Message-----
From: Wayne Davison [mailto:wayned at] 
Sent: Monday, August 29, 2005 9:37 PM
To: Moe, Mark
Cc: rsync at
Subject: Re: how to mirror only selected directories?

On Mon, Aug 29, 2005 at 04:41:31PM -0500, Moe, Mark wrote:
> But I can't have that particular side-affect since I'd like to have
> one site be the master for all folders except for "abc" folders and
> the 2nd site be the master for only the "abc" folders in this
> particular tree.

Your only choices are to tell rsync to include all directories (as Aaron
suggested), or to switch over to using --files-from.  No amount of
include fiddling with work around that limitation (see the man page's
description on how the directory traversal is recursive, and telling
rsync to block a directory blocks rsync from ever even looking at any of
the blocked dir's subdirs).

Switching to --files-from could take the output of a find command and
send it all in one go.  E.g.:

find . -name 'abc*' -type dir | rsync -av --files-from=- . host:/dest


More information about the rsync mailing list