Config Files, Version Control and Test before Reload/Restart

You will surely make a lot of modifications over time to your configuration files in /opt/bacula/etc, that’s why it is very good practice to:

  • include this folder in your backup policy

  • and/or put this folder under a revision control system of your choice eg. CVS/SVN/GIT/Mercurial

This will not only ensure the integrity of your configuration, especially if there are several system administrators involved in the backup process, but also allow to revert changes to a known good state.

Backup Job Configuration

Here is a simple FileSet/Job definition to do the configuration backup

Fileset {
   Name = "DisasterRecovery-fs"
   Include {
      Options {
         signature = SHA1
      }
      File = /opt/bacula/working/bacula.sql # where the Bacula catalog dump goes
      File = /opt/bacula/etc
      # you can add other files like keys, content of /etc to make this FileSet
      # more complete and adapted to your environment
   }
}

Job {
   Name = "DisasterRecovery-job"
   Type = "Backup"
   Client = "baculaServer"   # change to the name of the fd running on the Bacula DIR
   Fileset = "DisasterRecovery-fs"
   JobDefs = "Default-jd"
   Level = "Full"  # full backup is preferable
   Messages = "Standard"
   Pool = "DisasterRecovery-pool" # the pool we just defined to hold all config and catalog dumps
   Priority = 15 # Adjust to your priorities so this job runs last, after all jobs of your backup window
   Runscript {
      Command = "/opt/bacula/scripts/make_catalog_backup bacula bacula"
      RunsOnClient = no
      RunsWhen = Before
   }
   Runscript {
      Command = "/opt/bacula/scripts/delete_catalog_backup"
      RunsOnClient = no
      RunsWhen = After
   }
   Schedule = "NightAfterJobs"
   Storage = "OnDisk"
   WriteBootstrap = "/opt/bacula/bsr/catalog-backup.bsr" # important, can be sent by email
}

Check for Configuration Errors

After each modification, always check the configuration to avoid issues when reloading/restarting the Bacula Director process:

# /opt/bacula/bin/bacula-dir -t -u bacula -g bacula

And correct errors that are displayed or contact Support.

Note

The Director will not start if there are parsing errors in your configuration. Changed configuration will bot be applied if you use reload in your bconsole while there are errors in the configuration. Test your configuration and modifications. You might use the breload Bacula Enterprise command which will test your configuration, make a compressed archive and reload the director configuration as well. It is a convenient way to ensure you reload the configuration only if it is well formed.

Go back to the Testing and Monitoring chapter.

Go back to the Best Practices chapter.

Go back to the main Bacula Enterprise Configuration page.