User Tools

Site Tools


backup:bacula

Backup with Bacula opensource

https://tyler-hitzeman.github.io/bacula/install-server.html

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

http://blog.bacula.org/doku.php?id=howto_compile_bacula_client_on_aix

After install gcc and gcc++, I uncompress source and compile

[root@aix71]/root/rpmbuild/SOURCES/bacula-11.0.5# ./configure -prefix=/usr/local/bacula -enable-largefile -disable-libtool -with-pid-dir=/usr/local/bacula/var/run -with-subsys-dir=/usr/local/bacula/va
r/run/subsys --disable-conio --enable-build-stored --enable-client-only


==>Entering directory /root/rpmbuild/SOURCES/bacula-11.0.5/src/console
==>Entering directory /root/rpmbuild/SOURCES/bacula-11.0.5/manpages
==>Entering directory /root/rpmbuild/SOURCES/bacula-11.0.5/platforms

Configuration on Wed Sep 22 14:08:20 CEST 2021:

   Host:                      powerpc-ibm-aix7.1.5.0 -- aix 1
   Bacula version:            Bacula 11.0.5 (03 June 2021)
   Source code location:      .
   Install binaries:          /usr/local/bacula/sbin
   Install libraries:         /usr/local/bacula/lib
   Install config files:      /usr/local/bacula/etc
   Scripts directory:         /usr/local/bacula/etc
   Archive directory:         /tmp
   Working directory:         /opt/bacula/working
   PID directory:             /usr/local/bacula/var/run
   Subsys directory:          /usr/local/bacula/var/run/subsys
   Man directory:             /usr/share/man
   Data directory:            /usr/local/bacula/share
   Plugin directory:          /usr/local/bacula/lib
   C Compiler:                gcc 8.3.0
   C++ Compiler:              /usr/bin/g++ 8.3.0
   Compiler flags:             -g -O2 -Wall -x c++ -fno-strict-aliasing -fno-exceptions -fno-rtti
   Linker flags:
   Libraries:                 -lpthread  -lintl
   Statically Linked Tools:   no
   Statically Linked FD:      no
   Statically Linked SD:      no
   Statically Linked DIR:     no
   Statically Linked CONS:    no
   Database backends:         None
   Database port:
   Database name:             bacula
   Database user:             bacula
   Database SSL options:

   Job Output Email:          root@localhost
   Traceback Email:           root@localhost
   SMTP Host Address:         localhost

   Director Port:             9101
   File daemon Port:          9102
   Storage daemon Port:       9103

   Director User:
   Director Group:
   Storage Daemon User:
   Storage DaemonGroup:
   File Daemon User:
   File Daemon Group:

   Large file support:        no
   Bacula conio support:      no
   readline support:          no
   TCP Wrappers support:      no
   TLS support:               yes
   Encryption support:        yes
   ZLIB support:              yes
   LZO support:               no
   S3 support:                no
   enable-smartalloc:         yes
   enable-lockmgr:            no
   bat support:               no
   client-only:               yes
   build-dird:                yes
   build-stored:              yes
   Plugin support:            no
   AFS support:               no
   ACL support:               yes
   XATTR support:             yes
   GPFS support:              no
   systemd support:           no
   Batch insert enabled:      None

   Plugins:
   - Docker:                  no


[root@aix71]/root/rpmbuild/SOURCES/bacula-11.0.5#
backup/bacula.txt · Last modified: 2021/09/23 00:29 by manu