An overview of the Bacula components

Catalog – these are backup database file maintenance services. SQL databases such as PostgreSQL and MySQL are used to store the database. Bacula Director (DIR) — This software manages file and storage daemon backup and restore procedures. Storage daemons (SD) — this programme is in charge of the read and write operations on backup storage devices. Bacula Console — This is a command line interface that allows the backup administrator to communicate with the control and DIR.

How to install Bacula and MySQL

MariaDB can be used as a drop-in replacement for MySQL in this tutorial. Yum may be used to install MariaDB and Bacula. sudo yum install bacula-director bacula-storage bacula-director bacula-storage bacula-console mariadb-server bacula-client Once the installation is complete, use the following command to start MySQL: sudo systemctl mariadb start Then, using these scripts, create a Bacula database user and tables:

/usr/libexec/bacula/grant mysql privileges /usr/libexec/bacula/create mysql database -u root /usr/libexec/bacula/make mysql tables -u bacula

To get rid of harmful defaults and lock off access to your database system, run a simple security script. Run sudo mysql secure installation to begin the interactive script. Because your MySQL installation is new, you can skip the root password prompt. Accept the default values by continuing through the rest of the dialogue. Type the MySQL console as the root user and set the password for the user database: mysql -u root –p, then enter the root password you set when requested. Set the database user’s password: MAKE A MODIFICATION TO MYSQL.USER PASSWORD(‘bacula db password’) SET Password=PASSWORD(‘bacula db password’) WHERE User=’bacula’; FLUSH PRIVILEGES; replace the ‘Baculadbpassoword’ with a secure password. Exit the MySQL prompt and use the command sudo systemctl enable mariadb to enable MariaDB to boot.

Setting Bacula to use the MySQL library

Set Bacula to use the MySQL Library. You can do this by running command: sudo alternatives –config libbaccats.so On the prompt: Output There are 3 programs which provide ‘libbaccats.so’. Enter selection 1, which is MySQL to install the Bacula server/client components.

Creating backup and restoring directories

For Bacula to work on Centos 7, it needs a backup directory for backup archives and a restore directory for storing restored files. To create a new directory: sudo mkdir -p /bacula/backup /bacula/restore Change the file permissions to ensure only Bacula can access these location. To do this:

Configuring Bacula Director

Access the configurations files in the /etc/bacula directory. Open DIR configurations file in a text editor such as sudo vi /etc/bacula/bacula-dir.conf Locate the DIR resource and configure to listen to local host 127.0.0.1 by adding the DirAddress line:

Configuring local jobs

Find the job resource named ‘NackupClient1’ and change the name to ‘BackupLocalFiles. Change ‘RestoreFiles’ to ‘RestoreLocalFiles’ and the value of ‘where’ to /bacula/restore

Configuring file set

Configure storage daemon connection

Configure catalog connection

Generic catalog service

Configure pool

File Pool definition

Check DIR configuration

sudo bacula-dir -tc /etc/bacula/bacula-dir.conf – if it shows no error messages, you can move to configuring the storage daemon.

Configure Storage Daemon

Open SD configuration in a text editor: sudo vi /etc/bacula/bacula-sd.conf Configure the storage resource:

Configure storage device

Verify storage daemon configuration: sudo bacula-sd -tc /etc/bacula/bacula-sd.conf This completes the Bacula configuration. You can restart the Bacula server components.

Setting Bacula Component Passwords

DIR password command:

Storage daemon password command:

Local file daemon password command:

You can now start your Bacula components and test the backup job.