Bacula Backups Replication for a Secondary Standalone Director

There are several ways to replicate metadata and backup jobs to alternative sites by Bacula. You can use PostgreSQL replication for the Catalog, Backup jobs, or even third-party solutions such as DRBD. Another way is to import the backup made by another Bacula through its native Bscan tool, as we will see in this article. As shown in Figure 1, the Lead Director saves the backup copies either exclusively or exclusively in a secondary child daemon store, and the backup volumes can be scanned and imported to the Remote Director.

Bacula Backups Replication for a Secondary Standalone Director 1

Figure 1. Copy Jobs and Secondary Bacula Director Metadata Importation

The advantage of this method is that the two Directors are always active and can carry out restoration Jobs at any time.


After installing the secondary Bacula server, which contains Director, Storage, and Client, set up a Copy or backup Job to store data in that Storage Daemon. You will need to provide access to the two Directors in the bacula-sd.conf, as in the example:

Director {
   Name = "bacula_master-dir"
   Password = "30HLZox4K4idLu+j97SHDbXJYgduxUUD+kpVPyEgj1I9"

Director {
   Name = "bacula_remote-dir"
   Password = "14idLu+j97SH#GSADgqgq344idLu+j97SH4idLu+j97t"

Ideally, the backup volumes are all assembled in a directory or exclusive mount amount. For example, /mnt/volumes. Create a Job of type Admin on the Bacula Secondary server to import the volumes recorded through the bscan. You can use the following script (e.g.: /opt/bacula/scripts/bimporter) to perform the scanning of several or all volumes, which is executed through the RunScript directive (ClientRunBeforeJob).

# bimporter - Heitor Faria, Bacula LATAM (,,
# uses Bacula bscan to import several volumes to a new Catalog + Director
# Obs. 1: bscan requires connection to the new Catalog
# Usage: /opt/bacula/scripts/bimporter vol_name_string vols_dir
# E.g.: /opt/bacula/scripts/bimporter DedupDaily /mnt/volumes
# It is desired to only have Bacula volumes in the same archive device path.

for i in $(find $2 -printf "%f\n" |grep $1 | sort | grep -v -e .blk -e .idx -e .tch -e bin);
  do sudo -u bacula /opt/bacula/bin/bscan -s -m -V $i $2 >> /opt/bacula/working/bimporter.log;

Configure a Schedule to import the volumes at the desired periodicity and time, preferably after all the backup jobs have been completed. The backup Jobs imported into the secondary server will have the status Archived and will not be used for backup storage by the Secondary Director, only by the primary.

Disponível em: pt-brPortuguês (Portuguese (Brazil))enEnglishesEspañol (Spanish)

Leave a Reply