Hello backuppc fans,

Here I am again. I have to correct my 1st attempt to solve the nasty problem.

There are more than the 4 arrays that are changed by the browser. In every 
chapter of the config.pl file there are arrays that are changed by editing 
config.pl in a bowser.

The best way is to open the config.pl file in kate. You have a config-sample.pl 
file .
Open it in a split kate part (upper right indicator) Then you have the lasting 
work to scroll down both parts and change the brackets in the config.pl part. 
Then save it and copy it somewhere in your home. Whenever you changed the 
original config.pl file and it is messed up by the browser you can restore it 
from your copy. Don't forget to restart backuppc after that.

Now to the question where I got this information from:

https://bugzilla.redhat.com/show_bug.cgi?id=2091514

Well, it's not kubuntu but it counts:


Description of problem:
Any changes to BackuppC's configuration using the web interface results in 
BackupPC exiting with an error. This problem does not occur on Fedora 34 with 
BackupPC 4.4.0 & Perl v5.32.1. It appears that arrays are being changed into 
strings. Apologise in advance as this is my first hand written bug report.
.
.
.
Purely a guess that it's the problem, but it looks like curly braces {} are 
being replaced with ().


Once again I hope this will help you.

By the way: Until this nasty upgrade I could change any config.pl entry in a 
browser without problems!!!

Kind regards

Chris


> G.W. Haywood <bac...@jubileegroup.co.uk> hat am 14.09.2024 16:46 CEST 
> geschrieben:
> 
>  
> Hi there,
> 
> On Sat, 14 Sep 2024, oetschi.ex...@bluewin.ch wrote:
> 
> oetschi.ex...@bluewin.ch
> 
> > 1st of all: I use Backuppc for years and it is a very good tool.
> 
> +1
> 
> > ... When I upgraded ... I got some nasty problems:
> 
> This happens more or less every time I upgrade anything Debian-based.
> I upgraded to Bookworm in July and I've only just got the scanner to
> work again - and it *still* doesn't work with the GUI tools. :(
> 
> > ... After very long time I found a hint in a backuppc installation document:
> > Whenever you change something in the browser (e.g. WakeupSchedule)
> > then there are bracketts in arrays changed form [ ] or { } to ( )
> > and backuppc can't start anymore.
> 
> Where did you find this?  In Perl brace styles have strong meanings.
> They mean completely different things, they can't be interchanged.
> 
> > So there is the possibility to reactivate backuppc when you correct
> > the packuppc file "config.pl. When it is overcorrected then rsync
> > doesn't work and gives error messages.
> 
> I don't think rsync has anything specifically to do with this, I think
> it's probably just one of the (probably many) symptoms.
> 
> > Here I give you the correct notation of the arrays in config.pl (I only saw 
> > 4):
> >
> > $Conf{WakeupSchedule} = [ ... ]
> > $Conf{CgiNavBarLinks} = [ ... ]
> 
> These two are arrayrefs, that is they are scalars which refer to arrays.
> This seems correct according to my own config.pl.
> 
> In Perl you can create arrays with names, for example by writing
> 
> @array = (list);
> 
> whose elements you can access as  $array[n]
> 
> or wou can create anonymous arrays, for example by writing
> 
> $arrayref = [list];
> 
> which you can only access through references for example using
> 
> $arrayref->[n]
> 
> in this case.  Here is how I might do that with a one-liner on the
> command line for fun:
> 
> $ perl -e '$arrayref = [1,2,3]; print $arrayref->[1],"\n";'
> 2
> $
> 
> > $Conf{CgiStatusHilightColor} = { ... }
> 
> This seems correct according to my own config.pl.
> 
> It is a hashref.  For example
> 
> $ perl -e '$hashref = {a,1,b,2,c,3}; print $hashref->{b},"\n";'
> 2
> $
> 
> Note that in Perl '=>' is the same as ',' (in fact it is often called
> the 'fat comma') so I would probably more usually write
> 
> $ perl -e '$hashref = {a=>1,b=>2,c=>3}; print $hashref->{b},"\n";'
> 2
> $
> 
> > $Conf{CgiUserConfigEdit} = ( ... )
> 
> This last one seems wrong, at least compared with my own config.pl in
> which $Conf{CgiUserConfigEdit} is a hashref (i.e. its value is a Perl
> scalar containing a reference to a hash) so it's initialized using the
> syntax
> 
> $hashref = { list of key,value pairs };
> 
> It is perhaps slightly confusing that the scalar
> 
> $Conf{CgiUserConfigEdit}
> 
> is itself stored in (and so part of) the Perl hash called %Conf - and
> so it will be accessed using the Perl notation $hash{key}.  In this
> case, 'key' is CgiUserConfigEdit.  You *can* instead write
> 
> %Conf{CgiUserConfigEdit}
> 
> to access the same scalar but the Perl interpreter would probably
> scold you for that because it's bad form.
> 
> But above all note the difference between accessing part of the hash
> which is named
> 
> %Conf
> 
> by using syntax such as [*]
> 
> $Conf{$key} or $Conf{key}
> 
> and accessing part of an anonymous hash (which, er, does not have a
> name so I can't write it down:) through a reference which points to it
> by using the syntax
> 
> $hashref->{$key} or $hashref->{key} or $hashref->{'key'}
> 
> It isn't rocket science but, for the first couple of decades of using
> Perl it's amongst the more confusing aspects of the syntax.  There may
> be, unfortunately, quite a few of those.
> 
> [*] I generally prefer to quote 'barewords', even used as hash keys,
> so I'd use $Conf{'key'} rather than $Conf{key}.
> 
> -- 
> 
> 73,
> Ged.
> 
> 
> _______________________________________________
> BackupPC-users mailing list
> BackupPC-users@lists.sourceforge.net
> List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
> Wiki:    https://github.com/backuppc/backuppc/wiki
> Project: https://backuppc.github.io/backuppc/


_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to