Download Bacula Code (same for Server and Clients)

Go to the URL and fetch latest bacula-x.x.x Source.tar.gz file <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)

a.1) Debian 8 / Ubuntu:

# Mysql:
apt-get install -y build-essential libreadline6-dev zlib1g-dev liblzo2-dev mt-st mtx postfix libacl1-dev libssl-dev libmysql++-dev mysql-server

# Postgresql:
apt-get install -y build-essential libreadline6-dev zlib1g-dev liblzo2-dev mt-st mtx postfix libacl1-dev libssl-dev postgresql-server-dev-9.6 postgresql-9.6

a.2) CentOS 7 / RedHat:

Proceed to install the dependencies:

# 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

Add proper exceptions needed by Bacula for IPTABLES / Firewalld:

# IPTABLES
-A FW-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9101:9103 -j ACCEPT

# Firewalld
firewall-cmd --permanent --zone=public --add-port=9101-9103/tcp
firewall-cmd --reload

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

b) Compilation configure (all distros)

Proceed with the code configuration, changing the last options bellow accordingly (normally the last three):

# 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

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

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

c) Preparing Database:

Run create Bacula database, make tables and grant privileges scripts. If MYSQL:

# 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

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

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

Type bconsole at shell to access Bacula CLI (asterisk “*” prompt).

bconsole
Connecting to Director localhost:9101
1000 OK: debian-dir Version: 7.4.0 (16 January 2016)
Enter a period to cancel a command.
*

CLIENT ONLY Linux Deps, Compilation and Installation

a) Download Bacula Code (same for Server and Clients)

Go to the URL and fetch latest bacula-x.x.x Source.tar.gz file <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

b) Installing dependencies and specific preparations:

b.1) Debian 8 / Ubuntu:

apt-get install -y build-essential zlib1g-dev liblzo2-dev libacl1-dev libssl-dev
cd /usr/src/bacula*

b.2) CentOS 7 / RedHat:

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

Add proper exceptions needed by Bacula for IPTABLES:

# Iptables
-A FW-1-INPUT -m state --state NEW -m tcp -p tcp --dport 9102 -j ACCEPT

# Firewalld
firewall-cmd --permanent --zone=public --add-port=9102/tcp
firewall-cmd --reload

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

c) 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

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

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

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

service bacula-fd start

Windows Client Installation:

Go to the URL: http://blog.bacula.org/download-center/, and fetch most recent Windows Installation Packages according to your operating system architecture (32 or 64 bits), or download both here from my website:

http://www.bacula.us/winclients

Run the installer.

When asked, choose: Custom Installation; Client and Plugins components. 

Installer will also prompt to provide information about the actual Director name (that one that runs in the Linux Backup Server). You can fetch this information just accessing bconsole in that machine:

bconsole
Connecting to Director localhost:9101
1000 OK: debian-dir Version: 7.4.0 (16 January 2016)
Enter a period to cancel a command.
*

In this case my Director name is: debian-dir.

Proceed with the installation untill it is done. Close further dialog boxes.

Windows bacula-fd should be running (you can see it in services.msc) and it’s safe to attach it to Bacula Director adding a new respective Client Resource in bacula-dir.conf. But this should be covered by advanced topics.

Disponível em: pt-brPortuguês (Portuguese (Brazil)) enEnglish esEspañol (Spanish)

Close Menu