BackupPC-users

Re: [BackupPC-users] host config file command line editor ?

2009-01-08 17:53:09
Subject: Re: [BackupPC-users] host config file command line editor ?
From: Chris Robertson <crobertson AT gci DOT net>
To: backuppc-users AT lists.sourceforge DOT net
Date: Thu, 08 Jan 2009 12:47:31 -0900
Alex wrote:
> Hi there, 
> i'm not aware using Perl scripting, but ok with bash / php.
> Then, i'd like to know if there's a way to set values for per pc config file 
> using command line tool ?
>
> By exemple, like to change only FullKeepCnt value, but, has it is by default 
> written that way :
> $Conf&#123;FullKeepCnt&#125; = &#91;
> &nbsp; '400'
> &#93;;
>   

That's HTML for...

$Conf{FullKeepCnt} = [
 '400'
];

It should not be HTML encoded on disk.

$Conf is a hash.  The hash entry "FullKeepCnt" is a list (I think) with, 
in this case, one value: 400.

> It's a bit hard for me to parse this file and write back a new value.

PHP has the htmlspecialchars_decode 
(http://us.php.net/manual/en/function.htmlspecialchars-decode.php), 
which will take the nasty looking string you started with, and transform 
it to the proper on-disk setup, which should also be easier to 
manipulate (I think PHP might even properly utilize Perl hashes).

>  
>
> Didn't find any way of doing this on the wiki. I'd like to be able to do that 
> kind of thing without de cgi web interface, in order for me to be able to 
> change values through scripts.
>
> Thank you in advance for any advices :)

Chris

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
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/