bacula备份工具的编译安装+配置+测试

一、基本拓扑

server端:192.168.232.31 包括:bacula-dirbacula-sd bconsole

client端:192.168.232.32 包括:bacula-fdbconsole

二、安装

1、下载bacula-5.2.13.tar.gz(server和client端),mysql-community-release-el7-5.noarch.rpm(仅server端)

2、检查系统是否安装mysql相关,若有则删除干净

3、rpm -ivh mysql-community-release-el7-5.noarch.rpm(仅server端)

4、yum installmysql-devel(否则编译安装bacula,./configure提示找不到mysql.h文件)(仅server端)

5、server和client端解压bacula压缩包,cd bacula-5.2.13

server端执行./configure--prefix=/usr/local/bacula --with-mysql

client端执行./configure--prefix=/usr/local/bacula --enable-client-only

6、server端进入/usr/local/bacula/etc目录直接执行以下脚本文件:

./grant_mysql_privileges

./create_mysql_database

./make_mysql_tables

7、执行完成后查看mysql数据库showdatabases能够查看到bacula库

三、配置

提示:除了增加配置文件,还要注意baculadir baculasd baculafd console之间的密码和name相对应。


3.1 server端配置:

3.1.1、配置文件:bconsole.conf

Director {

 Name = ctl01-dir

 DIRport = 9101

 address = 192.168.232.31

 Password = "IM/TDS3/k2jrIXneqc67VAX9ag5qgVulqgCfGFDwWA5T"

}

3.1.2、配置文件:bacula-dir.conf

Director {                            # define myself

 Name = ctl01-dir

 DIRport = 9101                # where we listen for UAconnections

 QueryFile = "/usr/local/bacula/etc/query.sql"

 WorkingDirectory = "/usr/local/bacula/opt/bacula/working"

 PidDirectory = "/var/run"

 Maximum Concurrent Jobs = 1

 Password = "IM/TDS3/k2jrIXneqc67VAX9ag5qgVulqgCfGFDwWA5T"      #Console password

 Messages = Daemon

}

 

JobDefs {

 Name = "DefaultJob"

 Type = Backup

 Level = Incremental

 Client = ctl01-fd

 FileSet = "Full Set"

 Schedule = "WeeklyCycle"

 Storage = File

 Messages = Standard

 Pool = File

 Priority = 10

 Write Bootstrap ="/usr/local/bacula/opt/bacula/working/%c.bsr"

}

Job {

 Name = "BackupClient1"

 JobDefs = "DefaultJob"

}

 

Job {

 Name = "BackupCatalog"

 JobDefs = "DefaultJob"

 Level = Full

 FileSet="Catalog"

 Schedule = "WeeklyCycleAfterBackup"

 RunBeforeJob = "/usr/local/bacula/etc/make_catalog_backup.plMyCatalog"

 RunAfterJob  ="/usr/local/bacula/etc/delete_catalog_backup"

 Write Bootstrap ="/usr/local/bacula/opt/bacula/working/%n.bsr"

 Priority = 11                   #run after main backup

}

Job {

 Name = "RestoreFiles"

 Type = Restore

 Client=ctl01-fd

 FileSet="Full Set"

 Storage = File

 Pool = Default

 Messages = Standard

 Where = /tmp/bacula-restores

}

 

#########################definemyself####################

Job {

  Name = "FullBackup-zlj"

  Client = client_fd

  Level = Full

  Type = Backup

  FileSet = "Full Set"

  Schedule = "WeeklyCycle"

  Storage = File

  Messages = Standard

  Pool = dbpool

  Write Bootstrap ="/usr/local/bacula/working/client_fd.bsr"

}

##########################################################

 

FileSet {

 Name = "Full Set"

 Include {

   Options {

     signature = MD5

    }

      File = /aaa/bbb

  }

 

 Exclude {

   File = /usr/local/bacula/opt/bacula/working

   File = /tmp

   File = /proc

   File = /tmp

   File = /.journal

   File = /.fsck

  }

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值