BackupPC-users

[BackupPC-users] *BUMP* *BUMP* Re: BackupPC perl code hacking question... (Craig any chance you might have a suggestion?)

2011-02-07 14:17:20
Subject: [BackupPC-users] *BUMP* *BUMP* Re: BackupPC perl code hacking question... (Craig any chance you might have a suggestion?)
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, 07 Feb 2011 14:15:05 -0500
Let me rewrite my earlier posting to be more clear so maybe someone
can help me.

I am using 'rsyncd' to backup several of my systems.
Rather than storing the rsyncd secret in the BackupPC config files as
$Conf{RsyncdPasswd}, I would prefer to keep it stored only once in each client's
/etc/rsyncd.secrets file.
I then would like to use DumpPreUserCmd to retrieve the rsyncd secret
from the client and set the $Conf{RsyncdPasswd} then.

To do this, I used the fact that DumpPreUserCmd can be a perl
subroutine. Here is a simplified version of my actual command

$Conf{DumpPreUserCmd} = "&{sub {\$args[1]{RsyncdPasswd} = `ssh
-x mybackuypclient get_rsyncd_secret`}}";

This uses the fact that $args[1]=$Conf and $args[0]=$vars (see
BackupPC_dump). So, that \$args[1]{RsyncdPasswd} is equivalent to
$Conf{RsyncdPasswd}.

However, while this does set $Conf{RsyncdPasswd} properly within the
BackupPC_dump routine itself a I can verify by Data dumping it with
the routine, the value *FAILS* to be passed on to Rsync.pm where it is
actually used (indeed it remains set to '').

So, my question is is there any way to dynamically set Conf parameters
along the lines I am trying to do?


Jeffrey J. Kosowsky wrote at about 13:27:37 -0500 on Sunday, December 19, 2010:
 > Jeffrey J. Kosowsky wrote at about 12:53:28 -0500 on Monday, December 13, 
 > 2010:
 >  > For reasons I can explain later, I am trying to set
 >  > $Conf{RsyncdPasswd} in the main routine of BackupPC_dump (I am
 >  > actually trying to do something a bit more complex but this is easier
 >  > to understand).
 >  > 
 >  > Now since %Conf = $bpc->Conf(), I would have thought that for example
 >  > setting $Conf{RsyncPasswd} = "mypasswd" would then be pushed down to
 >  > all the routines called directly or indirectly from BackupPC_dump.
 >  > 
 >  > However, in Rsync.pm where the value of $Conf{RsyncPasswd} is actually
 >  > used, the value remains at ''.
 >  > 
 >  > (Of course setting the paramter the "normal" way within a config file
 >  > works and shows up as set in Rsync.pm)
 >  > 
 >  > So why isn't it working when I set it at the top level?
 >  > And what would I have to set at the top level to make it properly
 >  > passed to Rsync.pm?
 >  > 
 >  > I'm sure I must be missing something about how perl inherits and/or
 >  > overwrites variables... but I am stumped here...
 >  > 
 >  > 
 > ------------------------------------------------------------------------------
 >  > Lotusphere 2011
 >  > Register now for Lotusphere 2011 and learn how
 >  > to connect the dots, take your collaborative environment
 >  > to the next level, and enter the era of Social Business.
 >  > http://p.sf.net/sfu/lotusphere-d2d
 >  > _______________________________________________
 >  > 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/
 > 
 > ------------------------------------------------------------------------------
 > Lotusphere 2011
 > Register now for Lotusphere 2011 and learn how
 > to connect the dots, take your collaborative environment
 > to the next level, and enter the era of Social Business.
 > http://p.sf.net/sfu/lotusphere-d2d
 > _______________________________________________
 > 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/

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
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>
  • [BackupPC-users] *BUMP* *BUMP* Re: BackupPC perl code hacking question... (Craig any chance you might have a suggestion?), Jeffrey J. Kosowsky <=