BackupPC-users

Re: [BackupPC-users] Making a different per host setting without a pc/hostname.pc file

2009-08-10 02:09:16
Subject: Re: [BackupPC-users] Making a different per host setting without a pc/hostname.pc file
From: "Jeffrey J. Kosowsky" <backuppc AT kosowsky DOT org>
To: "General list for user discussion, questions and support" <backuppc-users AT lists.sourceforge DOT net>
Date: Mon, 10 Aug 2009 02:05:51 -0400
John Rouillard wrote at about 15:54:36 +0000 on Thursday, August 6, 2009:
 > Hi all:
 > 
 > I run multiple backupc servers over wan's and I am trying to implement
 > the following logic:
 > 
 >   If the host being backed up by the backuppc server is at the same
 >     site as the backuppc server, do not add --bwlimit to $Conf{RsyncArgs}.
 > 
 >   If the host being backed up by the backuppc server is at a different
 >     site, add "--bwlimit=64" to $Conf{RsyncArgs}.
 > 
 > Ideally this should be placed into the config.pl so it works for all
 > hosts, but I don't see any way to get the current hostname when the
 > configuration is loaded.
 > 
 > While I can create 100+ pc/hostname.pl files, this gets very messy
 > very quickly since I have to have at least two copies of each
 > pc/hostname.pl file for the two (or more) backup servers that are
 > backing up the data on the host. I have done this before with other
 > backup systems, and trying to audit and verify the configuration is a
 > total mess.
 > 
 > I would like to allow this to be overidden by pc/hostname.pl files as
 > there will be a dozen or so that need to have special bwlimit settings
 > because of the amount of data that they transfer, but this is maybe 20
 > files total, not the 200+ I am looking at having to manage.
 > 
 > So does anybody have any ideas? Is there a $Conf{CurrentHostName}
 > value I am not seeing? Other ideas on how to do this programatically?
 > 

I described a way to do this back in the archives...
Briefly, in /etc/BackupPC/pc, create links from each <hostname>.pl to
the config file you want to use for that group of hosts. Then use perl
code within that config file to recover the name of the specific host
by looking at the variable $_[1] which will be set to <hostname>.

Jeff


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
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/