Complex include/excludes with rsync?

Matt McCutchen matt at
Fri Jun 11 21:33:15 MDT 2010

On Thu, 2010-06-10 at 19:16 -0400, Brian Mathis wrote:
> I'm trying to use rsync filters to achieve the following result:
> Include /
> Exclude /home
> Include /home/user1
> I've been doing a lot of experimentation and at this point I'm just
> staring at the man page.  Rsync filters seem to be complicated, and a
> result of that I hope they are also powerful.
> How does one achieve this common pattern with rsync?

This has been asked many times before, for example:

The key is that you don't want to actually exclude /home because that
will prevent rsync from even descending to /home/user1 (search the man
page for "ineffectual").  Instead, exclude all the children of /home
other than /home/user1, for example:

+ /home/user1
- /home/*

Alternatively, there is a trick you can do with multiple source


More information about the rsync mailing list