rsyncd.conf exclude/include questions ??

Matt McCutchen matt at mattmccutchen.net
Wed Dec 26 01:14:35 GMT 2007


On Tue, 2007-12-25 at 14:48 +0100, Vincent Blondel wrote:
> Below what I configured in rsyncd.conf ..
> 
> [all]
> 	path = /
> 	uid = root
> 	gid = wheel
> 	read only = true
> 	include from = /home/rsync/etc/includes/rootfs
> 
> /home/rsync/etc/includes/rootfs
> 
> + /etc
> + /etc/make.conf

Good, you understand the need to include everything along the way to a
file.

> + /boot
> + /boot/*
> - *
> 
> This is the only way I found to only backup files directories I would like
> having on my backup system. This is working but I get a problem with it.
> 
> Is this really the way to do it ??

No.  You are using daemon filters, which are designed primarily as a
way for a daemon administrator to block access to files that clients
shouldn't see or mess with.  It would be more appropriate for the backup
system to choose which directories it wants using ordinary filters,
i.e., --include-from=path/to/includes/rootfs on the client command line.

Using a --files-from file (which the backup system can even read from
the remote system) with -r may be even more convenient than filters.

> Let's immagine I would like to backup complete /usr/local/
> directory. In such a way I should add two entries for each subdirectory ..
> 
> /usr/local/bin
> /usr/local/bin/*
> 
> You can really immagine my rootfs file contains thousands of lines .. this
> is why I post this message because I can immagine there is an easy way to
> do it but I haven't found it rigth now.

Yes, use a filter pattern ending in /*** to match a directory and
everything recursively inside it:

+ /usr/local/***

Matt



More information about the rsync mailing list