Classes
Rubycula consists of the classes listed below. The classes are not related to each other, but the topmost classes make use of the classes below them.
Classes being used most are BaculaConf, BaculaConfSection and BaculaConfMysql.
- Bacula - is meant to hold configurations of multiple components of the same Bacula server setup, to check their dependencies etc. Its functionality is not yet implemented.
- BaculaConf - holds multiple configuration sections (eg. Client, Fileset, Job) of one Bacula component (eg. bacula-dir)
- BaculaConfSection - holds configuration parameters of one section. Can be used recursively for one section's sub-sections (eg. Include under Fileset)
- BaculaConfMysql - queries and manipulates Bacula configuration sections and parameters in MySQL database
- BaculaConfFileParser - parses Bacula configuration files (mainly in order to import them to MySQL database)
In addition to the classes there's module BaculaBase which has some common functions used by all the classes.
MySQL database structure
See one example here: https://sourceforge.net/p/rubycula/code/105/tree/BaculaConf/trunk/bacula-dir.sql
Database structure defines which configuration sections, sub-sections and their parameters can be held and manipulated by class BaculaConfMysql.
Tables
- Each table (except the list-type tables, explained below) has a column 'id'
- There's a separate table for each configuration section
- Sub-sections
- Basing on assumption that Bacula configuration sections do not contain minus-marks '-', sub-sections are specified by prepending its parent sections with minus
- eg. table 'Fileset-Include' marks section 'Include' under its parent section 'Fileset'
- Every sub-section's table has a column for its parent section's ID in the form of '..._id'
Parameters
- Every configuration section's parameter is a separate column in a table (except the list-type tables, explained below)
- Configuration section's parameters that can be specified multiple times under a section are put into separate table with its name being in the form of '...-list_...'
- eg. "Fileset-Include-list_File" holds 'File' parameters of 'Include' section
- Templates
- Every section's row can consist a special parameter "SectionTemplate=1" which means that this row is taken as a template row
- If a section's parameter's value is NULL (instead of ""), this parameter's final value is taken from this section's template row (if it exists)
- eg. if the table 'Fileset' has one row with parameters "IgnoreFilesetChanges=yes" and "SectionTemplate=1", and the 2nd row with parameter "IgnoreFilesetChanges=NULL", the 2nd row's parameter 'IgnoreFilesetChanges' is finally seen as "yes"
- Related columns have also MySQL references defined
- eg. 'Job.Client' has a foreign key reference to 'Client.id'