CentOS/Compile Bacula server + Bacula client: Difference between revisions

From Mana zināšanu grāmata
Jauna lapa: <div class="mw-parser-output"> </div> <div class="mw-parser-output"> == Download Bacula Code (same for Server and Clients) == Go to the URL and fetch latest '''bacula-x.x.x...
 
m 1 revision imported
 
(No difference)

Latest revision as of 10:41, 16 April 2026

 

Download Bacula Code (same for Server and Clients)

Go to the URL and fetch latest bacula-x.x.x Source.tar.gzfile <https://sourceforge.net/projects/bacula/files/bacula/>, or download directly from my website, uncompress and move to code directory (/usr/src/bacula*) with the following commands:

 

wget -qO- http://bacula.us/current | tar -xzvf - -C /usr/src

 

Bacula Linux Server Deps and Compilation (all daemons and bconsole)

 

# Mysql:
yum -y install gcc-c++ readline-devel zlib-devel lzo-devel libacl-devel mt-st mtx postfix openssl-devel mariadb-devel
# Postgresql:
yum -y install gcc-c++ readline-devel zlib-devel lzo-devel libacl-devel mt-st mtx postfix openssl-devel postgresql-devel
 

 

Disable Selinux temporarily and permanently, or research and apply a Bacula policy.

 

setenforce 0
sudo sed -i "s/enforcing/disabled/g" /etc/selinux/config
sudo sed -i "s/enforcing/disabled/g" /etc/sysconfig/selinux

 

Compilation configure (all distros)

 

# Mysql:
cd /usr/src/bacula*
./configure --with-readline=/usr/include/readline --disable-conio --bindir=/usr/bin --sbindir=/usr/sbin --with-scriptdir=/etc/bacula/scripts --with-working-dir=/var/lib/bacula --with-logdir=/var/log --enable-smartalloc --with-mysql --with-archivedir=/mnt/backup --with-job-email=your@email.com.br --with-hostname=ip_or_qualified_name
# Postgresql:
cd /usr/src/bacula*
./configure --with-readline=/usr/include/readline --disable-conio --bindir=/usr/bin --sbindir=/usr/sbin --with-scriptdir=/etc/bacula/scripts --with-working-dir=/var/lib/bacula --with-logdir=/var/log --enable-smartalloc --with-postgresql --with-archivedir=/mnt/backup --with-job-email=your@email.com.br --with-hostname=ip_or_qualified_name

 

To build, install and enable Bacula daemons start at boot time (all distros):

 

make -j8 && make install && make install-autostart

 

Preparing Database:

 

# MySQL:
chmod o+rx /etc/bacula/scripts/*
/etc/bacula/scripts/create_mysql_database -u root -p && \
/etc/bacula/scripts/make_mysql_tables -u root -p && \
/etc/bacula/scripts/grant_mysql_privileges -u root -p

You will be prompted to type the MYSQL root user password.

If using POSTGRESQL database, proceed as follows:

# Postgresql:
postgresql-setup initdb
sed -i 's/peer/trust/g' /var/lib/pgsql/data/pg_hba.conf
sed -i 's/ident/trust/g' /var/lib/pgsql/data/pg_hba.conf
service postgresql start
chkconfig postgresql on
cp /etc/bacula/scripts/* /tmp
sudo -u postgres /tmp/create_postgresql_database
sudo -u postgres /tmp/make_postgresql_tables
sudo -u postgres /tmp/grant_postgresql_privileges

 

OR update

 

/etc/bacula/scripts/update_mysql_tables -u bacula -p

 

Start Bacula daemons for the first time. E.g. (all distros):

 

service bacula-fd start && service bacula-sd start && service bacula-dir start

 

CLIENT ONLY Linux Deps, Compilation and Installation

 

Download Bacula Code (same for Server and Clients)

Go to the URL and fetch latest bacula-x.x.x Source.tar.gzfile <https://sourceforge.net/projects/bacula/files/bacula/>, or download directly from my website, uncompress and move to code directory (/usr/src/bacula*) with the following commands:

wget -qO- http://bacula.us/current | tar -xzvf - -C /usr/src

 

yum -y install gcc-c++ zlib-devel lzo-devel libacl-devel openssl-devel
cd /usr/src/bacula*

 

setenforce 0
sudo sed -i "s/enforcing/disabled/g" /etc/selinux/config
sudo sed -i "s/enforcing/disabled/g" /etc/sysconfig/selinux

 

Compilation configure (all distros):

 

./configure --enable-client-only --enable-build-dird=no --enable-build-stored=no --bindir=/usr/bin --sbindir=/usr/sbin --with-scriptdir=/etc/bacula/scripts --with-working-dir=/var/spool/bacula/ --with-logdir=/var/log --enable-smartalloc

 

To build, install and enable bacula-fd daemons start at boot time:

 

make -j8 && make install && make install-autostart-fd

 

Start Bacula Client daemon for the first time. E.g.:

 

service bacula-fd start