Skip to main content
Bacula Configuration
====================

Scripts for Bacula configuration management

MOTIVATION
----------

Bacula's worst weakness is configuration. Adding one more host to your
current setup involves the following steps:

1. Install the client software
2. Create a bacula-fd.conf. It needs:
- Director stanza, with new passwords, for each director
- Messages stanza
- FileDaemon/Client stanza
3. Update your director(s) configuration:
- Client entry (with the name and password from bacula-fd.conf)
- One or more Job entries
- (Optional) Storage/Pool entries.
- (Optional) Create new Fileset/Schedule entries
4. (Optional) Update your storage(s) configuration:
- Pool
- Storage
- Device

All that data has to mesh together perfectly, or Bacula won't work.
Admittedly, you can short-circuit some of this by using the same passwords
everywhere and a standard set of directors and only one Message
configuration, and all hosts share the same storage pool and devices.

Then there's auditing. *You* know perfectly well what hosts are backed up
with which scheuldes, and the filesets involved. But do your coworkers?
What about your boss? Do you answer all the questions about which hosts
are backed up, and how, or do you want to delegate all of that to your
front-line support? How about the possibility of giving your install team
an easy tool for setting up new backups?

Finally, there's maintenance. Storage servers are taken (temporarily)
offline. Clients are decommissioned (which means all the jobs left in the
catalog at that point will never be pruned) or change roles. Directors are
replaced. New Filesets (and associated Jobs) need to be added to groups of
Clients. All of these events require tedious, error prone, manual updates.

WHAT IT DOES
------------

CLI tool to import an existing configuration

CLI tools to create/delete/edit all of the resources used by Bacula

CLI tools designed to drop into cron that will keep the director(s) and
storage daemon(s) configuration up-to-date, with appropriate activity
checks around restarts.

Web interface that yields an appropriate bacula-fd.conf like this:
`wget -O /etc/bacula/bacula-fd.conf http://director.example.com/cgi-bin/fd`

CLI tool for updating Confluence with live documentation. This will
include service and host notes, as well as schedules and filesets (where
possible: filesets that use < syntax will be incomplete).

CURRENT STATUS
--------------

Modulo any bugs, this seems to be complete as a framework. Tests are
incomplete, though, and I think it could use a little more polish
documentation-wise.

DEPENDENCIES
-------------

If you do not have mysql-python installed, setuptools will install it as a
dependency. If you would rather have it installed from an OS package, you
should do that first.

pyparsing is required if and only if you want to import an existing
configuration. I should note that this is making DRY code difficult, as
adding the parsing bits to the base class would make pyparsing required
everywhere, which is really not desirable.

DATABASE
---------

You'll need to create the database schema using
bacula_tools/data/bacula_configuration.schema

Today, we are MySQL-only. Adding support for PostgreSQL shouldn't be
difficult, but I'd have to see a desire for that before doing the work.

OS SETUP
---------

You will need to customize several values, whose defaults are in
bacula_tools/\_\_init\_\_.py. The easiest way to do so is to drop value
assignments into any/all of the configuration files:

/etc/bacula/bacula.conf
/usr/local/etc/bacula/bacula.conf
/usr/local/etc/bacula.conf
~/.bacula.conf

The files are read in that order, and all updates applied in that order.
In particular, you will want to set values for:

MYSQL_DB
MYSQL_HOST
MYSQL_USER
MYSQL_PASS

Here is an example script that will set it all up for you:

#! /bin/sh

python setup.py install
mysql -u root -p <<EOF
create schema baculacfg;
grant all on baculacfg.* to baculacfg identified by 'baculacfg';
use baculacfg
\. bacula_tools/data/bacula_configuration.schema
EOF

cat > /usr/local/etc/bacula.conf <<EOF
MYSQL_DB='baculacfg'
MYSQL_HOST='localhost'
MYSQL_USER='baculacfg'
MYSQL_PASS='baculacfg'
EOF

# import the current configuration
./bin/import_configuration /etc/bacula/*.conf

exit

Metadata

Release files for bacula_configuration 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bacula_configuration 1.0
File Size Uploaded Provenance
bacula_configuration-1.0.tar.gz 55.6 kB Without provenance Details

Release files / bacula_configuration-1.0.tar.gz

Download URL bacula_configuration-1.0.tar.gz
Size 55.6 kB
Tags Source
SHA-256 checksum
How to use checksums
46f49f665acfce6033a59c68f45651eae16224eb10100f8413d5225f0f27d56c
BLAKE2b-256 checksum
How to use checksums
2b21fbfd52ab4bc64506140d4300adb7f26467db2ddb15135c68943dd7598d07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for bacula_configuration 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page