User Tools

Site Tools


backup:bacula

This is an old revision of the document!


Backup with Bacula opensource

dnf install postgresql-server

postgresql-setup initdb

systemctl enable –now postgresql

sudo su - postgres

$ createuser bacula

$ psql

psql (10.14)

Type “help” for help.

postgres=# ALTER USER bacula PASSWORD 'bacula';

ALTER ROLE

postgres=# ALTER USER bacula LOGIN SUPERUSER CREATEDB CREATEROLE;

ALTER ROLE

postgres=# \q

$ exit

logout

Now you should uncomment the following setting in the /var/lib/pgsql/data/postgresql.conf file:

listen_addresses = 'localhost'

Now you need to change the connection configuration to the following format in the /var/lib/pgsql/data/pg_hba.conf file:

connection configuration of bacula on centos

Finally, you must restart the service using the following command to apply the changes:

systemctl restart postgresql.service

dnf install bacula-director bacula-storage bacula-console bacula-client

You can create databases, tables, and privileges by following the instructions below. Note that you must run them on behalf of the newly created Bacula user:

cd /usr/libexec/bacula/

sudo -u bacula ./create_postgresql_database

sudo -u bacula ./make_postgresql_tables

sudo -u bacula ./grant_postgresql_privileges

How to Configure Bacula on CentOS 8

In this section, we will teach you how to configure Bacula. It should note that you can use the following commands to create any folder to save backups and set bacula as its owner:

mkdir /opt/bacula

chown bacula:bacula /opt/bacula

Next, you need to open the /etc/bacula/bacula-dir.conf file and find the FileSet section called Full Set. Then here, in the Include section, you can set the folders needed for backup. Add /opt/bacula in the Exclude section:

FileSet { Name = “Full Set” Include { … File = /home/user File = /folder/to/backup } Exclude { File = /opt/bacula … }}

After successfully completing the previous step, you should now open the /etc/bacula/bacula-sd.conf file and set Archive Device = /opt/bacula for both Devices:

Device { … Archive Device = /opt/bacula … }

You can now start the service using the following commands:

systemctl enable –now bacula-dir.service

systemctl enable –now bacula-fd.service

systemctl enable –now bacula-sd.service

Note that the folders specified in the Include section of FileSet are now backed up daily. You can go to the Bacula Management Console using the following command to start the backup:

bconsole

Then enter the run command and follow the instructions. You can use the restore command to recover files. You can also enter status to view scheduled jobs, and then 1. Type help to see all available commands.

# dnf install perl-DBD-Pg

backup/bacula.1632153603.txt.gz · Last modified: 2021/09/20 18:00 by manu