На момент существования версии 9.x Bacula снова открывает доступ к бэкап-клиентам для систем на базе Windows, а также к пакетам для дистрибутивов Linux, пока что только для Debian, Ubuntu, CentOS и RedHat, поддержка большего числа дистрибутивов ожидается в будущем.
Для того, чтобы загрузить пакеты, Вам необходимо зарегистрироваться на вебсайте (регистрация бесплатна), а также предоставить ваше имя, фамилию и email-адрес здесь: https://blog.bacula.org/bacula-binary-package-download/
Далее вы получите ключ, состоящий из букв алфавита и цифр, который необходимо будет ввести во время работы скрипта.
Скрипт автоматической установки для Debian и CentOS
- Скачать скрипт установки, выставить разрешения и запустить
wget -c http://www.bacula.lat/wp-content/uploads/2018/09/bacula_community_install.txt -O /usr/local/bin/_bacula_community_install.sh chmod a+x /usr/local/bin/_bacula_community_install.sh /usr/local/bin/_bacula_community_install.sh
- Ввести полученный ранее по почте ключ Bacula
-------------------------------------------------- # Inform your Bacula Key # This key is obtained with a registration in Bacula.org. # https://www.bacula.org/bacula-binary-package-download/ Please, fill with your Bacula Key:
Пакеты всё ещё выходят через существенный промежуток времени после выпуска версий с исходным кодом, поэтому нет смысла ждать самой новой версии пакета как только выходит новая версия Bacula. Возможно в ближайшем будущем команда Bacula Community сможет решить данную проблему. А пока рекомендуется использовать версии для Debian и CentOS, эти версии — наиболее актуальные для каждой операционной системы. Данный скрипт был протестирован в CentOS 7.5 и Debian 9.5 (stretch).
- Выбрать версию программы для установки
# This script will only work with the latest Debian and CentOS versions -------------------------------------------------- Inform the Bacula version - 9.0.0 - 9.0.4 - 9.0.5 - 9.0.6 - 9.0.7 - 9.0.8 - 9.2.0 - 9.2.1 Choose your Bacula Version:
- Выбрать базу данных — MySQL или PostgreSQL
What do you want to do? 1) Install Bacula with PostgreSQL 2) Install Bacula with MySQL 3) Exit Select an option [1-3]:
*Уточнение: Этот скрипт предназначен для систем с чистой операционной системой, без наличия существующей базы данных или другой версии Bacula.
Ручная установка на Debian
#!/bin/bash bacula_version="9.4.3" bacula_key="XXXXXXXXXXXXX" linux_name="stretch" export DEBIAN_FRONTEND=noninteractive # Requirements to install Bacula by packages apt-get install -y zip wget bzip2 apt-transport-https # Download the repository keys wget -c https://www.bacula.org/downloads/Bacula-4096-Distribution-Verification-key.asc -O /tmp/Bacula-4096-Distribution-Verification-key.asc # Add key in the local repository apt-key add /tmp/Bacula-4096-Distribution-Verification-key.asc # Create the Bacula Community repository echo "# Bacula Community deb http://www.bacula.org/packages/${bacula_key}/debs/${bacula_version}/${linux_name}/amd64/ ${linux_name} main" > /etc/apt/sources.list.d/bacula-community.list ################################################################### # Install the MySQL or PostgreSQL database # Select the commands according to the desired option #================================================================== # Install MySQL wget -c https://repo.mysql.com/RPM-GPG-KEY-mysql -O /tmp/RPM-GPG-KEY-mysql --no-check-certificate apt-key add /tmp/RPM-GPG-KEY-mysql echo "deb http://repo.mysql.com/apt/debian/ stretch mysql-apt-config deb http://repo.mysql.com/apt/debian/ stretch mysql-5.7 deb http://repo.mysql.com/apt/debian/ stretch mysql-tools deb http://repo.mysql.com/apt/debian/ stretch mysql-tools-preview deb-src http://repo.mysql.com/apt/debian/ stretch mysql-5.7" > /etc/apt/sources.list.d/mysql.list apt-get update apt-get install -y mysql-community-server apt-get install -y bacula-mysql systemctl enable mysql systemctl start mysql # Create the database of Bacula data with MySQL /opt/bacula/scripts/create_mysql_database /opt/bacula/scripts/make_mysql_tables /opt/bacula/scripts/grant_mysql_privileges #================================================================== # Install PostgreSQL apt-get update apt-get install -y postgresql postgresql-client apt-get install -y bacula-postgresql # Enable and start PostgreSQL during boot systemctl enable postgresql systemctl start postgresql # Create the Bacula database with PostgreSQL su - postgres -c "/opt/bacula/scripts/create_postgresql_database" su - postgres -c "/opt/bacula/scripts/make_postgresql_tables" su - postgres -c "/opt/bacula/scripts/grant_postgresql_privileges" ################################################################### # Enable the start of daemons during boot systemctl enable bacula-fd.service systemctl enable bacula-sd.service systemctl enable bacula-dir.service # Start the Bacula daemons systemctl start bacula-fd.service systemctl start bacula-sd.service systemctl start bacula-dir.service # Create shortcut in /usr/sbin with Bacula binaries # This allows you to run the daemons and utilities # Without entering the /opt/bacula/bin directory for i in `ls /opt/bacula/bin`; do ln -s /opt/bacula/bin/$i /usr/sbin/$i; done # Replace the bconsole.conf address to localhost by default sed '/[Aa]ddress/s/=\s.*/= localhost/g' -i /opt/bacula/etc/bconsole.conf
Ручная установка на CentOS
#!/bin/bash # Enter the desired version bacula_version="9.4.3" # Enter the key received by email bacula_key="XXXXXXXXXXXXX" # Requirements to install Bacula by packages yum install -y zip wget bzip2 # Download the repository keys wget -c https://www.bacula.org/downloads/Bacula-4096-Distribution-Verification-key.asc -O /tmp/Bacula-4096-Distribution-Verification-key.asc # Add key in the local repository rpm --import /tmp/Bacula-4096-Distribution-Verification-key.asc # Create the Bacula Community repository echo "[Bacula-Community] name=CentOS - Bacula - Community baseurl=http://www.bacula.org/packages/${bacula_key}/rpms/${bacula_version}/el7/x86_64/ enabled=1 protect=0 gpgcheck=0" > /etc/yum.repos.d/bacula-community.repo ################################################################### # Install the MySQL or PostgreSQL database # Select the commands according to the desired option #================================================================== # Install MySQL rpm --import /tmp/RPM-GPG-KEY-mysql wget -c http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm -O /tmp/mysql57-community-release-el7-9.noarch.rpm rpm -ivh /tmp/mysql57-community-release-el7-9.noarch.rpm yum install -y mysql-community-server mysqld --initialize-insecure --user=mysql systemctl enable mysqld systemctl start mysqld yum install -y bacula-mysql # Create the database of Bacula data with MySQL /opt/bacula/scripts/create_mysql_database /opt/bacula/scripts/make_mysql_tables /opt/bacula/scripts/grant_mysql_privileges #================================================================== # Install PostgreSQL yum install -y postgresql-server yum install -y bacula-postgresql --exclude=bacula-mysql postgresql-setup initdb # Enable and start PostgreSQL during boot systemctl enable postgresql systemctl start postgresql # Create the Bacula database with PostgreSQL su - postgres -c "/opt/bacula/scripts/create_postgresql_database" su - postgres -c "/opt/bacula/scripts/make_postgresql_tables" su - postgres -c "/opt/bacula/scripts/grant_postgresql_privileges" ################################################################### # Disables selinux: setenforce 0 sudo sed -i "s/enforcing/disabled/g" /etc/selinux/config # Firewall Rules firewall-cmd --permanent --zone=public --add-port=9101-9103/tcp firewall-cmd --reload # Enable the start of daemons during boot systemctl enable bacula-fd.service systemctl enable bacula-sd.service systemctl enable bacula-dir.service # Start the Bacula daemons systemctl start bacula-fd.service systemctl start bacula-sd.service systemctl start bacula-dir.service # Create shortcut in /usr/sbin with Bacula binaries # This allows you to run the daemons and utilities # Without entering the /opt/bacula/bin directory for i in `ls /opt/bacula/bin`; do ln -s /opt/bacula/bin/$i /usr/sbin/$i; done # Replace the bconsole.conf address to localhost by default sed '/[Aa]ddress/s/=\s.*/= localhost/g' -i /opt/bacula/etc/bconsole.conf