On Monday 30 May 2011 22:32:14 Yuri Timofeev wrote: > 2011/5/28 Silver Salonen <sil...@ultrasoft.ee> > > > I have named the Ruby classes beginning with 'BaculaConf' and they are: > > ... - BaculaConfFileParser - backend for parsing configuration from files > > (eg. for importing configuration into MySQL) > > > > > I already wrote here in 2010: > > 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. > > But they're doing it wrong! > > For example, here is test configuration (which is written according to > "Bacula Main Reference: Customizing the Configuration Files") > contains no errors in terms of Bacula (I checked it) but it would be > wrong parsed (I have not tested it, but I'm sure of it) by 3rd parties > parsers (not native) : > > ----------------------------------------- > # comment1 > # comment2 > > c o n s o l e > { Name=name1; Password = "p; \\\a s s w o rd"; J o b A C L = *all\* > }Con sole { N a m e = "name 2"; Pass word = "password"; JobACL = > job/\1, job2, job3 > } > > ----------------------------------------- > > > I.e. in other words to parse with regexp any Bacula configuration will > be very difficult. > > > > > Stefan Muenkner suggested: > > 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.....
Again, my goal was not to parse the configuration files and make some tool constantly changing files which would in multi-user environment be quite a hassle. My objective was to get the configuration into a database and play around with it in there. And that objective was very well achieved :) But has the theory you wrote about gained some results too? BTW, I began with this stuff in May 2009, but it has also been on hold for a year. -- Silver ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users