BackupPC-users

Re: [BackupPC-users] Exclude complexity in version 2.1.2pl1

2008-12-11 12:50:36
Subject: Re: [BackupPC-users] Exclude complexity in version 2.1.2pl1
From: John Rouillard <rouilj-backuppc AT renesys DOT com>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Thu, 11 Dec 2008 17:48:02 +0000
On Thu, Dec 11, 2008 at 12:14:48AM -0800, Craig Barratt wrote:
> James writes:
> 
> > I have the following config line:
> > 
> > $Conf{BackupFilesExclude} = ['/proc', '/mnt', '/sys', '/home/
> > users',  ... , '+ /vz/dump', '/vz/*'];
> > 
> > But there is no /vz/dump in the backups.  What am I doing wrong?
> 
> You can't use the rsync syntax (+/-) in $Conf{BackupFilesExclude}.
> You can use $Conf{RsyncArgs} directly if you want.
> 
> Craig

Craig, it may not be intended to work, but in the current 3.x series
it does.

For example:

$Conf{BackupFilesExclude} = {
  '/var/log' => [
    '/nagios'
  ],
  '/home/yum' => [
     "+ /bin/**",
     "+ /SRPMS/**",
     "+ /install/kickstart/**",
     "+ /solaris_software/**",
     "- **/.svn/",
     "- /repository/**/core/**",
     "- /repository/**/core.orig/**",
     "- /repository/**/updates/",
     "- /repository/**/updates-test/**",
     "- /repository/**/xxx*/**",
     "- /repository/**/yyy-dev/**",
     "+ /repository/**/RPMS/**.rpm",
     "+ */",
     "- *",
   ]
};

works fine. The trick is that the arguments are passed to --exclude
and --exclude "+ something" acts as an include after it is shipped to
the remote rsync process.

This is really the only way to get a complex set of include/exclude
rules to rsync for backup needs.

Since you're the author of backuppc, I assume this wasn't intentional
but it does work and is very useful. I think Holger pointed it out in
an earlier email on this list and there are a few of us using it
AFAICT.

If RsyncArgs was settable/augmentable on a per share basis that would
also work. Something like:

$Conf{RsyncArgs} = "/path to rsync --and --common --options $RsyncShareArgs"

with 

$Conf{RsyncArgs} = {
  '/var/log' => [
    '--exclude /nagios'
  ],
  '/home/yum' => [
     "--include '/bin/**"',
     "--include '/SRPMS/*'*",
     ...
   ]
};

would be welcome as well as I could set bwlimits on a perhost
basis. Right now I have to override the whole RsyncArgs setting and
when I update it in the main config file I have to search and update
it in any pc/*.pl files I overrode it in.

-- 
                                -- rouilj

John Rouillard
System Administrator
Renesys Corporation
603-244-9084 (cell)
603-643-9300 x 111

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
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/

<Prev in Thread] Current Thread [Next in Thread>