Dan Pritts writes:

> > 1. Is it possible to use regexps for the $Conf{BackupFilesExclude}
> >    variable? 
> 
> I'm pretty sure that backuppc just hands your configuration entries
> to the program doing the transfer (rsync, tar, smbclient, whatever).

That's right.

> I don't know about tar or smbclient.  In the case of rsync, you cannot
> use a simple regular expression.  It has a fairly powerful grammar but
> it is also somewhat obtuse (for instance, trailing slashes on directory
> names matter).  I'd suggest reading (carefully) the rsync man page,
> experimenting, and then following up on the rsync mailing list with
> questions.  Look in the man page under EXCLUDE PATTERNS.
> 
> > The goal is to be able to exclude ay users
> >    TemporaryInternetFiles and mozilla-cache and any other cache that I
> >    can identify. Also, does anybody have ready-to-use-rules for this?
> 
> I have a followup question - is there a simple way to have a per-host
> config.pl add entries to $Conf{BackupFilesExclude} rather than replace it?
> I tried this:
> 
>   push (@{$Conf{BackupFilesExclude}}, '/netflow','/var/log/lastlog');
> 
> But it doesn't work, it still gets overridden.
> 
> Here i think is the relevant code snippet from BackupPC/Lib.pm:
> 
>     foreach $config ( @configs ) {
>         %Conf = ();
>         if ( !defined($ret = do $config) && ($! || $@) ) {
>             $mesg = "Couldn't open $config: $!" if ( $! );
>             $mesg = "Couldn't execute $config: $@" if ( $@ );
>             $mesg =~ s/[\n\r]+//;
>             return $mesg;
>         }
>         %{$bpc->{Conf}} = ( %{$bpc->{Conf} || {}}, %Conf );
>     }
> 
> 
> It's this last line of code that confuses me.  I'm wondering why
> this is done:
> 
>   %{$bpc->{Conf} || {}}

Unfortunately the code provides an empty $Conf each time is
parses the config file.  This line merges the new config
with the previous one:

         %{$bpc->{Conf}} = ( %{$bpc->{Conf} || {}}, %Conf );

This expression:

        %{$bpc->{Conf} || {}}

uses the current $bpc->{Conf} or an empty hash if $bpc->{Conf}
is not defined or empty.

Craig


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
BackupPC-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/backuppc-users
http://backuppc.sourceforge.net/

Reply via email to