BackupPC-users

Re: [BackupPC-users] Exclude and Only combo

2008-08-22 20:46:48
Subject: Re: [BackupPC-users] Exclude and Only combo
From: Holger Parplies <wbppc AT parplies DOT de>
To: "Ward... James Ward" <jeward AT torzo DOT com>
Date: Sat, 23 Aug 2008 02:45:42 +0200
Hi,

Craig Barratt wrote on 2008-08-22 13:18:30 -0700 [Re: [BackupPC-users] Exclude 
and Only combo]:
> James writes:
> 
> > I need to back up a Zimbra mail server, but I can't get the whole thing in 
> > any reasonable amount of time.  I want to exclude the usual stuff:
> > 
> > $Conf{BackupFilesExclude} = ['/proc', '/sys', '/mnt'];
> > 
> > But I also want to exclude all of /opt, except /opt/zimbra/backup.

I also read this as "all of / except /proc, /sys, /mnt, /opt, plus
/opt/zimbra/backup". I would implement this like BackupPC does, though it's
perhaps not intuitive :-). If you are using rsync(d), that is. It won't work
with tar or smb.

$Conf {BackupFilesExclude} =
  [ '/proc', '/sys', '/mnt',
    '+ /opt/zimbra', '/opt/*',
    '+ /opt/zimbra/backup', '/opt/zimbra/*' ];

The trick is that all of BackupFilesExclude gets passed to rsync as
'--exclude=/...' arguments. Rsync treats '--exclude=+ /something' as an
include. Thus you're including /opt/zimbra, excluding the rest of /opt, and
likewise including /opt/zimbra/backup and excluding the rest of /opt/zimbra.
That should get you what you want. For a better explanation see
BackupPC::Xfer::Rsync, lines 156 and following.

Note that the order matters: '+ /opt/zimbra' needs to be before '/opt/*' and
likewise for '.../backup'. If it feels more comprehensible, you may change
'/opt/*' to '- /opt/*' (and likewise for other excludes). You need a single
space character between +/- and the path.

I was just wondering why we can't let BackupPC do this. The reason is that
BackupPC would also generate a '+ /opt' and '/*' so that everything except
/opt/zimbra/backup would be left out. This is what your version requests:

> > $Conf{BackupFilesExclude} = ['/proc', '/sys', '/mnt', '/opt'];
> > $Conf{BackupFilesOnly) = '/opt/zimbra/backup';

"only backup /opt/zimbra/backup and exclude some things that are already left
out anyway". We know you don't want that, so we can simply leave out the
exclusion of '/*'.

Regards,
Holger

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
BackupPC-users mailing list
BackupPC-users AT lists.sourceforge DOT net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/