include/exclude - how to transfer /etc and /home/users from /?

Tomasz Chmielewski mangoo at
Mon Jun 27 20:57:47 GMT 2005

Wayne Davison schrieb:
> On Mon, Jun 27, 2005 at 04:05:47PM +0200, Tomasz Chmielewski wrote:
>>I'm trying to copy recursively only /etc, /home/samba/profiles and 
> The manpage explains how you need to include all directories on the way
> down to the file/dir in the recursive descent.  Or just use --files-from
> and it is usually much easier than trying to get the include/exclude
> rules right.  Some examples of both the include/exclude syntax and the
> --files-from syntax are in this recent email on the subject:

sorry, I just can't make it work.

I just spent another hour reading the manual and trying to figure it 
out, but I can't make it.

--include="/etc" \

this one works and the whole /etc is transferred.

--include="/home/samba/profiles" \

this is similar to the "/etc" above, but it doesn't work at all, nothing 
from /home/samba/profiles is transferred

--include="/home/samba/shared" \

nothing from /home/samba/shared is transferred

--exclude="/*" \

this seem to work, as nothing from / is transferred (I don't need /proc 
or /usr).
But this also seem to exclude "/home/samba/shared" and 

Perhaps it would be easier to use three different rsyncs:

backup at CON:/etc /home/CON/etc

backup at CON:/home/samba/profiles /home/CON/home/samba/profiles

backup at CON:/home/samba/shared /home/CON/home/samba/shared

but I see no reason why it should be three commands, instead of one 
(well, it seems hard to include and exclude the diredtories you want - 
at least for me).


More information about the rsync mailing list