1. 首页 > 软件下载 > 正文

Bacula下载-Bacula企业级备份软件下载地址-Bacula企业级备份软件下载方法

1. Bacula简介与版本说明

Bacula是一套企业级开源备份解决方案,提供完整的数据备份、恢复和验证功能。它采用模块化架构,支持多种存储介质和操作系统平台。更多学习教程www.fgedu.net.cn

Bacula最新版本:

Bacula 15.0.x(最新稳定版)- 发布于2024年,提供增强的安全性和性能优化

Bacula 13.0.x – 长期支持版本,适合生产环境

Bacula 11.0.x – 旧版稳定版本,维护支持中

Bacula 9.6.x – 传统稳定版本

Bacula架构组件:

Bacula Director:备份控制器,负责调度和管理备份作业

Bacula Storage:存储守护进程,负责数据写入存储介质

Bacula File:文件守护进程,运行在客户端负责数据采集

Bacula Catalog:目录数据库,存储备份元数据

Bacula Console:管理控制台,提供用户交互界面

2. Bacula下载方式

Bacula提供源码编译和预编译包两种下载方式。学习交流加群风哥微信: itpux-com

方式一:官方源码下载

# 下载Bacula源码包
# cd /fgedudb/bacula
# wget https://sourceforge.net/projects/bacula/files/bacula/15.0.2/bacula-15.0.2.tar.gz

# 下载输出案例如下:
–2026-04-04 11:00:15– https://sourceforge.net/projects/bacula/files/bacula/15.0.2/bacula-15.0.2.tar.gz
Resolving sourceforge.net… 104.18.12.149
Connecting to sourceforge.net|104.18.12.149|:443… connected.
HTTP request sent, awaiting response… 302 Found
Location: https://downloads.sourceforge.net/project/bacula/bacula/15.0.2/bacula-15.0.2.tar.gz [following]
Length: 4567890 (4.4M) [application/x-gzip]
Saving to: ‘bacula-15.0.2.tar.gz’

bacula-15.0.2.tar.gz 100%[===============================================>] 4.35M 5.2MB/s in 0.8s

2026-04-04 11:00:16 URL:https://downloads.sourceforge.net/project/bacula/bacula/15.0.2/bacula-15.0.2.tar.gz [4567890/4567890] -> “bacula-15.0.2.tar.gz” [1]

# 验证下载文件
# ls -lh bacula-15.0.2.tar.gz
-rw-r–r– 1 root root 4.4M Apr 4 11:00 bacula-15.0.2.tar.gz

# 验证MD5校验和
# md5sum bacula-15.0.2.tar.gz
a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6 bacula-15.0.2.tar.gz

方式二:下载预编译RPM包

# 添加Bacula社区仓库
# vi /etc/yum.repos.d/bacula.repo
[bacula-community]
name=Bacula Community
baseurl=https://www.bacula.org/packages/bacula-community/rpms/15/el7/x86_64/
enabled=1
gpgcheck=1
gpgkey=https://www.bacula.org/packages/bacula-community/rpms/bacula-community.key

# 导入GPG密钥
# rpm –import https://www.bacula.org/packages/bacula-community/rpms/bacula-community.key

# 查看可用包
# yum list bacula*
bacula-client.x86_64 15.0.2-1.el7 bacula-community
bacula-common.x86_64 15.0.2-1.el7 bacula-community
bacula-console.x86_64 15.0.2-1.el7 bacula-community
bacula-director.x86_64 15.0.2-1.el7 bacula-community
bacula-storage.x86_64 15.0.2-1.el7 bacula-community
bacula-tray-monitor.x86_64 15.0.2-1.el7 bacula-community

方式三:下载Windows客户端

# 下载Windows客户端安装包
# cd /fgedudb/bacula
# wget https://sourceforge.net/projects/bacula/files/bacula-win64/15.0.2/bacula-win64-15.0.2.exe

# 下载输出案例如下:
–2026-04-04 11:05:30– https://sourceforge.net/projects/bacula/files/bacula-win64/15.0.2/bacula-win64-15.0.2.exe
Resolving sourceforge.net… 104.18.12.149
Connecting to sourceforge.net|104.18.12.149|:443… connected.
HTTP request sent, awaiting response… 302 Found
Length: 15678901 (15M) [application/octet-stream]
Saving to: ‘bacula-win64-15.0.2.exe’

bacula-win64-15.0.2.exe 100%[===============================================>] 14.96M 6.8MB/s in 2.2s

2026-04-04 11:05:32 URL:https://downloads.sourceforge.net/project/bacula/bacula-win64/15.0.2/bacula-win64-15.0.2.exe [15678901/15678901] -> “bacula-win64-15.0.2.exe” [1]

# 验证文件
# ls -lh bacula-win64-15.0.2.exe
-rw-r–r– 1 root root 15M Apr 4 11:05 bacula-win64-15.0.2.exe

3. 系统环境准备

Bacula依赖数据库存储元数据,支持MySQL、PostgreSQL和SQLite。学习交流加群风哥QQ113257174

步骤1:安装依赖包

# 安装编译依赖
# yum install -y gcc gcc-c++ make autoconf automake
# yum install -y openssl-devel readline-devel ncurses-devel
# yum install -y zlib-devel lzo-devel libacl-devel

# 安装数据库(以MySQL为例)
# yum install -y mysql-server mysql-devel

# 或安装PostgreSQL
# yum install -y postgresql-server postgresql-devel

# 启动数据库服务
# systemctl start mysqld
# systemctl enable mysqld

# 初始化数据库
# mysql_secure_installation

# 输出案例如下:
Securing the MySQL server deployment.

Enter password for user root:
VALIDATE PASSWORD PLUGIN can be used to test passwords…
Press y|Y for Yes, any other key for No: y
Please set the password for root here.
New password:
Re-enter new password:
Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y
Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y
All done!

步骤2:创建Bacula用户和目录

# 创建Bacula用户
# groupadd -g 133 bacula
# useradd -u 133 -g bacula -d /var/spool/bacula -s /sbin/nologin bacula

# 创建目录结构
# mkdir -p /etc/bacula
# mkdir -p /var/spool/bacula
# mkdir -p /var/log/bacula
# mkdir -p /backup/bacula-storage

# 设置权限
# chown -R bacula:bacula /var/spool/bacula
# chown -R bacula:bacula /var/log/bacula
# chown -R bacula:bacula /backup/bacula-storage
# chmod 750 /backup/bacula-storage

4. Bacula安装实战

完成环境准备后,开始安装Bacula各组件。更多学习教程公众号风哥教程itpux_com

步骤1:编译安装Bacula

# 解压源码包
# cd /fgedudb/bacula
# tar -xzf bacula-15.0.2.tar.gz
# cd bacula-15.0.2

# 配置编译选项(MySQL版本)
# ./configure \
–prefix=/usr \
–sbindir=/usr/sbin \
–sysconfdir=/etc/bacula \
–with-scriptdir=/etc/bacula/scripts \
–with-workingdir=/var/spool/bacula \
–with-pid-dir=/var/run \
–enable-smartalloc \
–enable-conio \
–with-mysql \
–with-openssl \
–with-readline \
–with-python=3

# 配置输出案例如下:
checking for gcc… gcc
checking whether the C compiler works… yes
checking for a BSD-compatible install… /usr/bin/install -c
checking for mysql_config… /usr/bin/mysql_config
checking for MySQL support… yes
checking for OpenSSL… yes
Configuration on Fri Apr 4 11:15:30 CST 2026:

Host: x86_64-unknown-linux-gnu
Bacula version: 15.0.2 (15 February 2024)
Source code location: .
Install binaries: /usr/sbin
Install configuration files: /etc/bacula
Scripts directory: /etc/bacula/scripts
Working directory: /var/spool/bacula
MySQL support: yes
OpenSSL support: yes

# 编译安装
# make
# make install

# 编译输出案例如下:
Making all in src
make[1]: Entering directory ‘/fgedudb/bacula/bacula-15.0.2/src’
Making all in lib
gcc -c -O2 -Wall -fPIC -I. -I.. bsys.c
gcc -c -O2 -Wall -fPIC -I. -I.. bnet.c

make[1]: Leaving directory ‘/fgedudb/bacula/bacula-15.0.2/src’
make[1]: Entering directory ‘/fgedudb/bacula/bacula-15.0.2’
make[1]: Nothing to be done for ‘all’.
make[1]: Leaving directory ‘/fgedudb/bacula/bacula-15.0.2’

步骤2:初始化数据库

# 创建Bacula数据库
# cd /etc/bacula/scripts
# ./create_mysql_database

# 输出案例如下:
Creation of bacula database succeeded.

# 创建数据库表
# ./make_mysql_tables

# 输出案例如下:
Creation of Bacula MySQL tables succeeded.

# 创建数据库用户
# ./grant_mysql_privileges

# 输出案例如下:
Privileges for user bacula granted on database bacula.

# 验证数据库
# mysql -u bacula -p bacula -e “SHOW TABLES;”
Enter password:
+——————+
| Tables_in_bacula |
+——————+
| BaseFiles |
| CDImages |
| Client |
| Counters |
| Device |
| File |
| FileSet |
| Filename |
| Job |
| JobHisto |
| JobMedia |
| Location |
| LocationLog |
| Log |
| Media |
| MediaType |
| Pool |
| RestoreObject |
| Status |
| Storage |
| UnsavedFiles |
| Version |
+——————+
22 rows in set (0.00 sec)

步骤3:安装为系统服务

# 创建systemd服务文件
# vi /etc/systemd/system/bacula-dir.service
[Unit]
Description=Bacula Director
Documentation=man:bacula-dir(8)
After=network.target mysqld.service postgresql.service

[Service]
Type=forking
User=bacula
Group=bacula
ExecStart=/usr/sbin/bacula-dir -c /etc/bacula/bacula-dir.conf
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/var/run/bacula-dir.9101.pid
Restart=on-failure

[Install]
WantedBy=multi-user.target

# vi /etc/systemd/system/bacula-sd.service
[Unit]
Description=Bacula Storage Daemon
Documentation=man:bacula-sd(8)
After=network.target

[Service]
Type=forking
User=bacula
Group=bacula
ExecStart=/usr/sbin/bacula-sd -c /etc/bacula/bacula-sd.conf
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/var/run/bacula-sd.9103.pid
Restart=on-failure

[Install]
WantedBy=multi-user.target

# vi /etc/systemd/system/bacula-fd.service
[Unit]
Description=Bacula File Daemon
Documentation=man:bacula-fd(8)
After=network.target

[Service]
Type=forking
User=root
Group=bacula
ExecStart=/usr/sbin/bacula-fd -c /etc/bacula/bacula-fd.conf
ExecReload=/bin/kill -HUP $MAINPID
PIDFile=/var/run/bacula-fd.9102.pid
Restart=on-failure

[Install]
WantedBy=multi-user.target

# 重载systemd
# systemctl daemon-reload

5. Bacula配置实战

Bacula配置文件采用模块化设计,需要配置Director、Storage和File三个守护进程。from:www.itpux.com

步骤1:配置Director

# 编辑Director配置文件
# vi /etc/bacula/bacula-dir.conf

Director {
Name = fgedu-dir
DIRport = 9101
QueryFile = “/etc/bacula/scripts/query.sql”
WorkingDirectory = “/var/spool/bacula”
PidDirectory = “/var/run”
Maximum Concurrent Jobs = 20
Password = “fgedu-dir-password”
Messages = Daemon
}

Catalog {
Name = MyCatalog
dbname = “bacula”; dbuser = “bacula”; dbpassword = “bacula_password”
}

Storage {
Name = File
Address = 192.168.1.51
SDPort = 9103
Password = “fgedu-sd-password”
Device = FileStorage
Media Type = File
}

Client {
Name = fgedu-fd
Address = 192.168.1.51
FDPort = 9102
Catalog = MyCatalog
Password = “fgedu-fd-password”
File Retention = 30 days
Job Retention = 6 months
AutoPrune = yes
}

Pool {
Name = Full
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 365 days
Maximum Volume Bytes = 50G
Maximum Volumes = 100
Label Format = “Full-”
}

Pool {
Name = Incremental
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Volume Retention = 30 days
Maximum Volume Bytes = 10G
Maximum Volumes = 100
Label Format = “Inc-”
}

步骤2:配置Storage Daemon

# 编辑Storage配置文件
# vi /etc/bacula/bacula-sd.conf

Storage {
Name = fgedu-sd
SDPort = 9103
WorkingDirectory = “/var/spool/bacula”
Pid Directory = “/var/run”
Maximum Concurrent Jobs = 20
}

Director {
Name = fgedu-dir
Password = “fgedu-sd-password”
}

Device {
Name = FileStorage
Media Type = File
Archive Device = /backup/bacula-storage
LabelMedia = yes
Random Access = yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
Maximum Concurrent Jobs = 5
}

Messages {
Name = Standard
director = fgedu-dir = all
}

步骤3:配置File Daemon

# 编辑File Daemon配置文件
# vi /etc/bacula/bacula-fd.conf

Director {
Name = fgedu-dir
Password = “fgedu-fd-password”
}

FileDaemon {
Name = fgedu-fd
FDport = 9102
WorkingDirectory = /var/spool/bacula
Pid Directory = /var/run
Maximum Concurrent Jobs = 20
}

Messages {
Name = Standard
director = fgedu-dir = all, !skipped, !restored
}

风哥提示:配置文件中的密码必须保持一致,Director配置中的Storage密码必须与Storage配置中的Director密码相同。建议使用强密码并妥善保管。

6. 备份作业配置实战

配置完成后,创建备份作业定义和计划。

步骤1:定义文件集

# 添加文件集配置
# vi /etc/bacula/bacula-dir.conf

FileSet {
Name = “Linux-Full-Set”
Include {
Options {
signature = MD5
compression = GZIP
noatime = yes
}
File = /etc
File = /home
File = /var/log
File = /var/spool
File = /fgedudb
}
Exclude {
File = /var/log/bacula
File = /var/spool/bacula
File = /proc
File = /sys
File = /dev
File = /tmp
}
}

FileSet {
Name = “Database-Set”
Include {
Options {
signature = MD5
compression = GZIP
}
File = /backup/mysql
File = /backup/oracle
}
}

步骤2:定义备份作业

# 添加作业配置
# vi /etc/bacula/bacula-dir.conf

JobDefs {
Name = “DefaultJob”
Type = Backup
Level = Incremental
Client = fgedu-fd
FileSet = “Linux-Full-Set”
Schedule = “WeeklyCycle”
Storage = File
Messages = Standard
Pool = Incremental
Priority = 10
Write Bootstrap = “/var/spool/bacula/%c.bsr”
}

Job {
Name = “Backup-fgedu”
JobDefs = “DefaultJob”
Client = fgedu-fd
FileSet = “Linux-Full-Set”
Pool = Full
Full Backup Pool = Full
Incremental Backup Pool = Incremental
}

Job {
Name = “Backup-Database”
JobDefs = “DefaultJob”
FileSet = “Database-Set”
Schedule = “DailyBackup”
Pool = Full
Level = Full
}

Job {
Name = “Restore-fgedu”
Type = Restore
Client = fgedu-fd
FileSet = “Linux-Full-Set”
Storage = File
Pool = Full
Messages = Standard
Where = /restore
}

步骤3:定义调度计划

# 添加调度配置
# vi /etc/bacula/bacula-dir.conf

Schedule {
Name = “WeeklyCycle”
Run = Full 1st sun at 23:00
Run = Differential 2nd-5th sun at 23:00
Run = Incremental mon-sat at 23:00
}

Schedule {
Name = “DailyBackup”
Run = Full daily at 02:00
}

Schedule {
Name = “MonthlyFull”
Run = Full on 1 at 00:00
}

步骤4:启动服务并验证

# 启动所有Bacula服务
# systemctl start bacula-dir
# systemctl start bacula-sd
# systemctl start bacula-fd

# 设置开机自启
# systemctl enable bacula-dir
# systemctl enable bacula-sd
# systemctl enable bacula-fd

# 验证服务状态
# systemctl status bacula-dir
● bacula-dir.service – Bacula Director
Loaded: loaded (/etc/systemd/system/bacula-dir.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2026-04-04 11:30:00 CST; 10s ago
Main PID: 25123 (bacula-dir)
Tasks: 5
Memory: 45.2M
CGroup: /system.slice/bacula-dir.service
└─25123 /usr/sbin/bacula-dir -c /etc/bacula/bacula-dir.conf

Apr 04 11:30:00 fgedu.net.cn systemd[1]: Started Bacula Director.

# 使用bconsole验证连接
# bconsole
Connecting to Director 192.168.1.51:9101
1000 OK: fgedu-dir Version: 15.0.2 (15 February 2024)

Enter a period to cancel a command.

*status director
fgedu-dir Version: 15.0.2 (15 February 2024)
Daemon started 04-Apr-26 11:30. Jobs: run=0, running=0.
Heap: heap=270,336 smbytes=90,726 max_bytes=90,726 bufs=249 max_bufs=249
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 04-Apr-26 23:00 Backup-fgedu Inc-0001
Full Backup 10 05-Apr-26 02:00 Backup-Database Full-0001
====
Running Jobs:
No Jobs running.
====
Terminated Jobs:
No Terminated Jobs.
====

You have messages.
*quit

7. 生产环境最佳实践

在生产环境中部署Bacula需要考虑性能优化、安全加固和监控告警。

性能优化配置

# 优化Director配置
# vi /etc/bacula/bacula-dir.conf

Director {
Name = fgedu-dir
DIRport = 9101
Maximum Concurrent Jobs = 50
Maximum Connections = 100

}

# 优化Storage配置
# vi /etc/bacula/bacula-sd.conf

Storage {
Name = fgedu-sd
SDPort = 9103
Maximum Concurrent Jobs = 50
Maximum Connections = 100

}

Device {
Name = FileStorage
Maximum Concurrent Jobs = 10
Maximum Block Size = 20M
Minimum Block Size = 512K

}

安全加固配置

# 启用TLS加密通信
# vi /etc/bacula/bacula-dir.conf

Director {
Name = fgedu-dir

TLS Enable = yes
TLS Require = yes
TLS CA Certificate File = /etc/bacula/certs/ca.crt
TLS Certificate = /etc/bacula/certs/director.crt
TLS Key = /etc/bacula/certs/director.key
}

# 配置防火墙规则
# firewall-cmd –permanent –add-port=9101/tcp
# firewall-cmd –permanent –add-port=9102/tcp
# firewall-cmd –permanent –add-port=9103/tcp
# firewall-cmd –reload

# 输出案例如下:
success

监控与告警配置

# 配置邮件通知
# vi /etc/bacula/bacula-dir.conf

Messages {
Name = Standard
mailcommand = “/usr/sbin/bsmtp -h smtp.fgedu.net.cn -f \”\(Bacula\) \<%r\>\” -s \”Bacula: %t %e of %c %l\” %r”
operatorcommand = “/usr/sbin/bsmtp -h smtp.fgedu.net.cn -f \”\(Bacula\) \<%r\>\” -s \”Bacula: Intervention needed for %j\” %r”
mail = admin@fgedu.net.cn = all, !skipped
operator = admin@fgedu.net.cn = mount
console = all, !skipped, !saved
append = “/var/log/bacula/bacula.log” = all, !skipped
catalog = all
}

# 配置日志轮转
# vi /etc/logrotate.d/bacula
/var/log/bacula/*.log {
weekly
rotate 12
compress
delaycompress
missingok
notifempty
create 0640 bacula bacula
}

生产环境建议:Bacula Director建议部署在高可用服务器上,Storage建议使用专用存储服务器。备份介质建议采用磁带库或对象存储实现异地备份。定期进行恢复演练验证备份有效性。建议配置监控告警,及时发现备份失败情况。

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息