[TriLUG] rsyncd.conf

Rick DeNatale rick.denatale at gmail.com
Fri Feb 10 17:21:10 EST 2006


On 2/10/06, Alan Porter <porter at trilug.org> wrote:
>
> I recently installed a BackupPC system at $WORK, and it
> seems to hum along nicely.  It backs up our PC's, and it's
> got a nice web interface.
>
> See http://backuppc.sourceforge.net/
>
> Now I am thinking about installing it at home.  If I want
> to back up the entire PC's drive, it works great, but I
> am trying to be a little more selective about it.
>
> If I want to back up:
>  - the entire drive - works OK
>  - a few top-level directories - works OK
>  - just /home, /etc, and /var/log - does not get /var/log
>
> A little background...
>
> BackupPC will fetch files from the client PC's using one of
> three mechanisms: (1) Samba (2) rsync/ssh (3) rsync/rsyncd.
> I am using option #3.  On the client PC, I installed rsync
> and set RSYNC_ENABLE=true in /etc/defaults/rsync.
>
> I know that the problem has to do with my /etc/rsyncd.conf
> file.  I would like to define one "module", but I'd like
> that module to contain a list of directories to back up.
>
> My /etc/rsyncd.conf file looks like this:
>
>    # GLOBAL OPTIONS
>    log file=/var/log/rsyncd
>    pid file=/var/run/rsyncd.pid
>
>    # the one module that the BackupPC server looks for
>    [backuppc]
>       comment = backuppc files
>       path = /
>       use chroot = no
>       read only = no
>       list = no
>       uid = root
>       exclude = /* /*/
>       include = /home/ /root/ /etc/ /var/log/
>       auth users = backuppc
>       secrets file = /etc/rsyncd.secrets
>       hosts allow = bpcserver
>       <some options deleted>
>
> I don't want to pull in all of /var just to get /var/log.
> I don't want to define several modules: backuppc[1-9].
> I don't want to make a detailed list of excludes from /var.
> I just want to back up MY list of directories.
>
> Anyone know the proper way to tell rsyncd to do that?
>
>
> Alan

Might I suggest that you tell backuppc to use rsync as the xfer
method.  This doesn't require an rsync daemon on the client but runs
rsync over ssh as required.

You should probably do this in a hostname.pl file where hostname is
the name of the client instead of the main backuppc config file, then
list the host(s) you want to backup in the /etc/backuppc/hosts file.
This allows you to have different options for different clients. For
example here, I backup my linux laptop with rsync, and my wife's
windows machine with samba.  The relevant config options are:

$Conf{XferMethod} = 'rsync';
and then
$Conf{RsyncShareName} = ['/home /root /etc /var/log'];

I've got a very similar setup here chez DeNatale. In my case it seems
to like the paths sans the trailing slashes (i.e. it works that way)
since rsync makes a distinction between paths with trailing slashes
and those without this might be important.

Here's my complete bill.pl file which is the configuration to backup
my laptop named bill
#
# Local server backup of /etc as user backuppc
#
$Conf{XferMethod} = 'rsync';

$Conf{RsyncShareName} = ['/home', '/etc', '/var'];
$Conf{RsyncClientCmd} = '$sshPath -q  -l backuppcclient $host sudo
~/bin/rsyncSend $argList+';
$Conf{RsyncClientRestoreCmd} = '$sshPath -q -l backuppcclient $host
sudo ~/bin/rsyncSend $argList+';

The last two lines are a tad line and might wrap, they both start with $
--
Rick DeNatale

Visit the Project Mercury Wiki Site
http://www.mercuryspacecraft.com/



More information about the TriLUG mailing list