Hi,
Gene Horodecki wrote on 15.11.2007 at 11:26:41 [Re: [BackupPC-users]
Hierarchy/Groups]:
> If you choose this route, what you may want to try is setting permissions
> on the 'master' config file to '555' to prohibit any kind of writing to it.
that is principally a good idea, except that, judging by the code, it won't
work out of the box. TextFileWrite in BackupPC::Storage::Text overwrites a
file by first writing to a new file, renaming the old file out of the way,
and finally renaming the new file (and I'm not going to comment on how this
does not atomically replace the file ;-). All this requires is write permission
to the directory, which is required for changes to any config files, so you
can't simply revoke that.
What you *can* do is 'chmod +t' the directory and chown the files you want
to protect to root (or anything != backuppc) - provided backuppc is not the
owner of the directory :).
> "Paul Archer" <[EMAIL PROTECTED]> wrote:
> > 12:08pm, Renke Brausse wrote:
> >
> >> Hello,
[Attribution of original poster missing; Lai Chen Kang wrote on 15.11.2007:]
> >>> Is it possible to setup a sort of groupings for servers such that there
> >>> is only one set of config per group?
> >> [copy-host-functionality of the webGui]
> > [symlink the individual machines' config.pl files]
You should actually even be able to do something like inheritance. Create a
config file for each of your groups, eg. "webserver.pl", "fileserver.pl",
"whatever.pl". Then, for a specific server, create the server config file,
define what kind of server it is, and override individual settings, eg.:
do 'webserver.pl';
$Conf {ClientNameAlias} = 'foo';
# don't back up log files on this one, they're not important
push @{$Conf {BackupFilesExclude} -> {'/var'}}, '/log';
This is untested. You might need to add the path to webserver.pl in the
"do". The last line assumes that you set $Conf{BackupFilesExclude} in
webserver.pl and want to add '/log' to the excludes for the '/var' share.
Of course, you do not have to override any settings if you don't want to :).
Such a config file probably won't work with the web based config editor, but
you should be able to edit webserver.pl and such, provided you've got
appropriate host entries, which would, in turn, make BackupPC try to back
up these hosts, which probably would not work, unless you have hosts named
"webserver", "fileserver" and so on :-). Making the files read-only as
explained above should prevent the config editor from doing anything bad.
In fact, you *could* have a writable master config file for one real host
(meaning owner backuppc), editable through the GUI, and "read-only" config
files for the other hosts (owner root) consisting of "do 'master.pl';" and
anything you might need to override, which would *not* be editable through
the GUI. In that way, you get to keep the functionality of the web GUI and
gain consistency among host groups.
If you're not overriding anything, you can do the same with softlinks,
providing you've got a +t directory and the softlinks don't belong to
backuppc (normally, ownership and permissions of softlinks are not important,
but in this case, ownership is).
If you need multiple inheritance, there's no reason you can't do something
like
do 'ou1.pl'; # settings specific to all hosts of one
# organizational unit
do 'webserver.pl'; # settings specific to a web server
do 'ping_ssh.pl'; # probe host by connection to ssh port instead of
# ping
but chances are, you'll need to edit those by hand and pay attention to how
they interact (ou1.pl might set $Conf {XferMethod} and webserver.pl the
corresponding ShareName, or, more subtly, BackupFilesOnly and
BackupFilesExclude).
Sorry for suggesting all of this, but Perl configuration files do give you a
lot of power if you don't depend on using the web based configuration
editor.
Regards,
Holger
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
BackupPC-users mailing list
[email protected]
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/