Bacula-users

Re: [Bacula-users] How to parse Bacula conf files

2010-10-21 11:21:24
Subject: Re: [Bacula-users] How to parse Bacula conf files
From: Stefan Muenkner <stefan.muenkner AT uks DOT eu>
To: Hugo Letemplier <hugo.let.35 AT gmail DOT com>
Date: Thu, 21 Oct 2010 17:19:13 +0200
While I think it might be worthwhile having the configuration dumped in
XML (== machine readable format), I think the other way around is not
something that would be needed in bacula itself.  There is a whole bunch
of XSLT processors that would transform a XML-file into a bacula
configuration file. You only need to provide the XSLT file and adapt that
for future versions.  Provided there are no principal problems anyway,
since not everything maps cleanly into XML and back again.

But in the end somebody needs to do that by actually write, testing and
documenting some code.....

Stefan

On 21.10.2010 16:24, Hugo Letemplier wrote:
> a XML parse intreprator for bacula as well as in input than in output
> could be a very cool project for next versions.
> that would also make easier the implementation of a gui for modeling
> or monitor a backup architecture.
> 
> 
> 2010/10/21 Stefan Muenkner <stefan.muenkner AT uks DOT eu>:
>> On 20.10.2010 16:25, Josh Fisher wrote:
>>>
>>> On 10/19/2010 8:28 AM, Yuri Timofeev wrote:
>>>> Hi
>>>>
>>>> During development the prototype of the my new system (Webacula 5.5),
>>>> I tried to parse the bacula-dir.conf.
>>>> However, this is probably not possible with simple regexp's.
>>>> It turned out that some applications, for example, Webmin does this
>>>> with a regexp
>>>
>>> I don't think regexp will work. The best way is to translate the C code
>>> from the Bacula source into PHP. Since you are requiring PHP 5.0 or
>>> above, I think, then the values could be placed in a class object, just
>>> as Bacula puts them in C struct. Or, since all directives are key=value
>>> pairs, you could just put them in an associative array.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>>> http://p.sf.net/sfu/nokia-dev2dev
>>> _______________________________________________
>>> Bacula-users mailing list
>>> Bacula-users AT lists.sourceforge DOT net
>>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>
>> a better solution still would be to enable bacula to dump its
>> configuration as a  (e.g.) XML or JSON file, probably in a rather generic
>> way so that future changes to the structure/content of the config files
>> would not need additional work on behalf of the bacula developers. XML or
>> JSON - as examples -  could be easily picked up by php, ruby, perl,
>> python, java you name it whatever.....
>>
>> --
>> this is an empty signature :-)
>>
>> ------------------------------------------------------------------------------
>> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
>> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
>> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
>> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
>> http://p.sf.net/sfu/nokia-dev2dev
>> _______________________________________________
>> Bacula-users mailing list
>> Bacula-users AT lists.sourceforge DOT net
>> https://lists.sourceforge.net/lists/listinfo/bacula-users
>>


-- 
this is an empty signature :-)

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users