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

Interface

https://www.bacula.org/11.0.x-manuals/en/console/Baculum_API_Web_GUI_Tools.html

https://www.bacula.org/downloads/baculum/stable-11/centos8/

Test access to database

I use Postgres

root@...:/etc/bacula# bacula-dir -t -d 100
bacula-dir: dird.c:185-0 Debug level = 100
bacula-dir: dir_plugins.c:160-0 Load dir plugins
bacula-dir: dir_plugins.c:162-0 No dir plugin dir!
bacula-dir: postgresql.c:1126-0 db_init_database first time
bacula-dir: postgresql.c:241-0 pg_real_connect done
bacula-dir: postgresql.c:243-0 db_user=bacula db_name=bacula db_password=
bacula-dir: dird.c:993 Could not open Catalog "MyCatalog", database "bacula".
bacula-dir: dird.c:998 postgresql.c:248 Unable to connect to PostgreSQL server. Database=bacula User=bacula
Possible causes: SQL server not running; password incorrect; max_connections exceeded.
[root@baclulasrv01 bacula]# bconsole
Connecting to Director localhost:9101
1000 OK: 103 bacula-dir Version: 9.0.6 (20 November 2017)
Enter a period to cancel a command.
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: Scheduled
     5: Network
     6: All
Select daemon type for status (1-6): 1
bacula-dir Version: 9.0.6 (20 November 2017) x86_64-redhat-linux-gnu redhat Enterprise 8.0
Daemon started 20-Sep-21 18:10, conf reloaded 20-Sep-2021 18:10:36
 Jobs: run=2, running=0 mode=0,0
 Heap: heap=135,168 smbytes=87,219 max_bytes=133,175 bufs=294 max_bufs=323
 Res: njobs=3 nclients=1 nstores=2 npools=3 ncats=1 nfsets=2 nscheds=2

Scheduled Jobs:
Level          Type     Pri  Scheduled          Job Name           Volume
===================================================================================
Incremental    Backup    10  21-Sep-21 23:05    BackupClient1      Vol-0001
Full           Backup    11  21-Sep-21 23:10    BackupCatalog      Vol-0001
====

Running Jobs:
Console connected at 21-Sep-21 12:05
No Jobs running.
====

Terminated Jobs:
 JobId  Level      Files    Bytes   Status   Finished        Name
====================================================================
     1  Full         650    77.91 M  OK       20-Sep-21 23:05 BackupClient1
     2  Full           1    123.2 K  OK       20-Sep-21 23:10 BackupCatalog

====
You have messages.

Bacula client on AIX

backup/bacula.1632312043.txt.gz · Last modified: 2021/09/22 14:00 by manu