Chinaunix首页 | 论坛 | 博客
  • 博客访问: 180640
  • 博文数量: 32
  • 博客积分: 3453
  • 博客等级: 上尉
  • 技术积分: 244
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-04 21:27
文章分类
文章存档

2011年(8)

2010年(24)

分类: 服务器与存储

2011-11-07 15:06:55

文档信息

文档名称

Bacula 配置

文档编写者

friend-sen

文档版本编号

V1.0

文档类型

技术文档

2010-07-28

备注

由于本人英文水平有限,文档中诸多翻译都是结合个人技术知识翻译,仅作参考,以官方文档为准。博客格式比较乱,附件中的文档更适合查阅。

测试环境:Bacula Server系统:Centos 5.3;Bacula Client for Linux系统:RHEL 4;Bacula Client for Windows系统:Windows 7。

所有权声明

文档里的资料多数可以在我的博客(http://sens.cublog.cn)中找到,博客中大部分文档也是在网络中引用或转载,我在这里做了整理及修改,目的是为了集大家之所长,为使用Bacula的大家提供更好帮助。如有侵权,还望通知,将予以改正。许多专业术语是我个人的理解,文档中有错误的地方,或者可以用更好的语言表达的,希望将好的建议告诉我,以便错误得到及时更正,共同为使用Bacula的大家提供便利。


1. 各配置文件的关系.. 2

2. 主控端配置文件详解.. 3

l Director{}. 3

l JobDefs{}. 5

l Job{}. 5

l Schedule{}. 10

l Fileset{}. 12

l Client{}. 20

l Storage{}. 21

l Catalog{}. 21

l Messages{}. 22

l Pool{}. 22

l Console{}. 23

l 主控端配置文件范例.. 23

3. 存储端配置文件详解.. 32

l Director{}. 32

l Storage{}. 33

l Device{}. 33

l Messages{}. 34

l 存储端配置文件范例.. 34

4. 客户端配置文件详解.. 36

l Director{}. 36

l FileDaemon{}. 36

l Messages{}. 37

l 客户端配置文件范例.. 37

5. 管理配置文件介绍.. 38

5.1. 控制台配置文件.. 38

l Director{}. 38

l ConsoleFont{}. 39

l Console{}. 39

l 控制台配置文件范例.. 39

5.2. 监控配置文件.. 40

l Monitor{}. 40

l Director{}. 40

l Storage{}. 40

l Client{}. 40

l 监控配置文件范例.. 41

6. 启动Bacula. 42

文档下载

组成Bacula备份系统有三个主要的部分,包括主控端、存储端和客户端,这三个部分都有各自的配置文件,相对应的是主控端(bacula-dir.conf,下同)、存储端(bacula-sd.conf,下同)和客户端(bacula-fd.conf,下同),各配置文件中的部分项存在一定的关联,官方也用一张图形象的表示了它们之间的关系,看下图:

      4

图中使用箭头连接主控端配置文件的相关项与其它配置文件的相关项,所连接的相关项的值必须是相同的。下面用文件说明一下:

  • 主控端配置文件的Director{}项。

Name值与控制台配置文件(bconsole.conf,下同)的Director{}项、存储端配置文件的Director{}项及客户端配置文件的Director{}项的Name值相同;Password值与控制台配置文件的Director{}项的Password值相同。

  • 主控端配置文件的Storage{}项。

Device值与存储端配置文件的Device{}项的Name值相同;

MediaType值与存储端配置文件的Device{}项的MediaType值相同;

Password值与存储端配置文件的Director{}项的Password值相同。

  • 主控端配置文件的Client{}项。

Password值与客户端配置文件的Director{}项的Password值相同。

理解了图中表示的意思,对配置Bacula非常有帮助。所以希望大家先熟悉此图之后再做配置。

 

下图是主控端配置文件的主要选项。安装Bacula之后,主控端配置文件中的都默认启用了这些选项,图中对其做了简单的介绍:

        b1

为什么Job项与其他选项用线连接呢?

因为在执行一个任务(Job)的过程中,需要调用到其他选项的参数设置,从而使得任务的完整。如果这么多的参数全部写在Job选项里,那么就会将导致Job选项的参数设置非常复杂,这样的模块化设计显得更直观,也能使程序运行更效高效。下面用一句话说明一下:

建立一个备份任务(Job)时,就需要选择一台备份的计算机(Client),然后确定需要备份的文件(FileSet)及备份时间周期和备份类型(Schedule),最后选择备份到哪里(Storage)以及文件存储的方式(Pool),让管理者知道备份任务的的情况(Messages)。

注意:Job项也可以是还原任务。

Bacula Director服务管理所有的备份,恢复,验证和存档事务,所以主控端的配置文件也是最为复杂的。下面将对配置文件中各选项的参数设置进行详细的介绍。

Director{}部分的官方文档见The Director Resource

以下是关于Director{}部分的参数说明

Name = name

指定主控端名称,必选。默认为计算机名-dir。

Description = text

用文本字段描述主控端,可选。

Password = UA-password

设置主控端密码,一般控制台连接时需要使用。必选。

Messages = Messages-resource-name

引用Messages{}的Name值。必选。

Working Directory = Directory

指定工作目录,目录必须已经存在,必选。一般在./configure时已经指定。

Pid Directory = Directory

指定进程ID文件存放目录,必选。一般在./configure时已经指定。

Scripts Directory = Directory

指定脚本目录,可选。

QueryFile = Path

指定一个目录和文件的路径,必选。

Heartbeat Interval = time-interval

可选。

Maximum Concurrent Jobs = number

设置同时执行的最大任务数量,默认设置为1。

FD Connect Timeout = time

指定主控端尝试联系客户端开始一个job的超时时间。如果超时将取消该job,默认为30分钟。

SD Connect Timeout = time

指定主控端尝试联系存储端开始一个job的超时时间。如果超时将取消该job,默认为30分钟。

DirAddresses = IP-address-specification

指定地址和端口监听控制台连接,用法可以查看官方文档。

DirPort = port-number

指定端口号监听控制台连接,默认是9101。不与DirAddresses参数同时使用。

DirAddress = IP-Address

指定地址监听控制台连接,可选。如果它被指定,那么此地址将与主控端绑定;如果未指定将绑定到本机当前使用的地址。只允许指定一个地址。不与DirAddresses参数同时使用。

DirSourceAddress = IP-Address

可选。

Statistics Retention = time

指定job记录统计在目录数据库中保留的时间,默认为5年。主要是用于容量规划等等,不是以恢复为目的。

VerId = string

MaximumConsoleConnections = number

指定控制台最大同时连接数,默认是20。

范例

Director { # define myself

Name = ser1-dir

DIRport = 9101 # where we listen for UA connections

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

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

PidDirectory = "/usr/local/bacula/bin/working"

Maximum Concurrent Jobs = 1

Password = "111" # Console password

Messages = Daemon

}

 

  • {}

JobDefs选项允许所有可以出现在Job选项中的参数。但是,JobDefs 不会创建一个作业(Job),而是Job{}引用它的参数设置。

JobDefs选项的参数细节可以参考Job选项。

下面贴一下主控端配置文件中默认生成的JobDefs选项范例

JobDefs {

Name = "DefaultJob"

Type = Backup

Level = Incremental

Client = ser1-fd

FileSet = "Full Set"

Schedule = "WeeklyCycle"

Storage = File

Messages = Standard

Pool = File

Priority = 10

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

}

 

定义一个客户端的备份作业或还原作业的相关参数。Job{}部分的官方文档见The Job Resource

当需要引用其他选项的参数设置时,设置为相对应的Name值就可以了。下面用图体现一下,以便更好的理解:

      b2

下面是Job{}可以设置的详细参数

Name = name

指定Job{}名称,必选。命名自行指定,建议由计算机名和Job类型组成,如ser1-backup表示计算机ser1的备份任务。

Enabled = yesno

是否启用此Job{},可选。

Type = job-type

Job类型,定义备份作业或还原作业。取值有Backup、Restore、Verify和Admin。

Level = job-level

备份类型,当type参数为备份作业时,取值有Full、Incremental和Differential;还原作业不需要设置此选项;当type参数为Verify作业时,取值有InitCatalog、Catalog、VolumeToCatalog和DiskToCatalog。

Accurate = yesno

是否启用精确模式。

Verify Job = Job-Resource-Name

当type参数为Verify作业时,引用Job{}的Name值;不设置时,默认为记录的最后一次Job。

JobDefs = JobDefs-Resource-Name

引用JobDefs{}的Name值。可选。

Bootstrap = bootstrap-file

指定引导文件,启动还原作业时自动创建。此参数只用于Job类型为Restore时,此时必选。

Write Bootstrap = bootstrap-file-specification

当执行备份作业是,将作业记录写入到一个引导文件。此参数只用于Job类型为Backup时,此时必选。

Client = client-resource-name

引用Client{}的Name值,也就是选择需要备份的客户端。必选。

FileSet = FileSet-resource-name

引用FlieSet{}的Name值,也就是选择客户端需要备份的目录及文件。必选。

Messages = messages-resource-name

引用Messages{}的Name值。必选。

Pool = pool-resource-name

引用Pool{}的Name值。必选。

Full Backup Pool = pool-resource-name

引用Pool{}的Name值。可选。

Differential Backup Pool = pool-resource-name

引用Pool{}的Name值。可选。

Incremental Backup Pool = pool-resource-name

引用Pool{}的Name值。可选。

Schedule = schedule-name

引用Schedule{}的Name值,设置作业执行的时间周期,可选。如果没有指定,此任务必须手动执行。

Storage = storage-resource-name

引用Storage{}的Name值,选择执行Job时的存储端。必选。

Max Start Delay = time

最大启动时间,默认为0,无限制。定义作业开始时间的最大超时时间。如果一个作业计划在凌晨1:00,但此时有其他工作再运行,可能就会延迟执行,如果设置为3600(一个小时)到2:00还未执行,此作业将被取消,防止作业在白天执行。

Max Run Time = time

指定作业最大允许运行的时间。

Incremental|Differential Max Wait Time = time

从bacula 2.3.18此参数已弃用。

Incremental Max Run Time = time

指定增量作业最大允许运行的时间。

Differential Max Wait Time = time

指定差异作业最大允许运行的时间。

Max Run Sched Time = time

最大开始时间和最大运行时间的和

Max Wait Time = time

最大等待时间

Max Full Interval = time

见官方文档

Prefer Mounted Volumes = yesno

默认为yes

Prune Jobs = yesno

默认为no

Prune Files = yesno

默认为no

Prune Volumes = yesno

默认为no

RunScript {body-of-runscript}

添加脚本使用作业更好的执行,详细查看官方文档

Run Before Job = command

引用脚本,详见官方文档。

Run After Job = command

引用脚本,详见官方文档。

Run After Failed Job = command

引用脚本,详见官方文档。

Client Run Before Job = command

引用脚本,详见官方文档。

Client Run After Job = command

引用脚本,详见官方文档。

Rerun Failed Levels = yesno

当运行任务运行失败后一次备份作业时,将提升更高的备份类型,比如差异备份异常终止,下次备份将执行完全备份。默认为no。

Spool Data = yesno

默认为no

Spool Attributes = yesno

默认为no

Where = directory

指定文件还原到该客户端的目录。此参数只用于Job类型为Restore时。如果没有指定文件将被还原到其原始位置。默认为/tmp/bacula-restores

Add Prefix = directory

此参数只用于Job类型为Restore时。

Strip Prefix = directory

此参数只用于Job类型为Restore时

RegexWhere = expressions

此参数只用于Job类型为Restore时。

Replace = replace-option

此参数只用于Job类型为Restore时。当恢复的文件存在时,执行什么操作。取值有always、ifnewer、ifolder和never。

Prefix Links=yesno

默认为no

Maximum Concurrent Jobs = number

允许同时运行的作业数量,默认为1。

Reschedule On Error = yesno

是否重新执行发生错误的作业,默认为no。

Reschedule Interval = time-specification

重新执行发生错误的作业的间隔时间。

Reschedule Times = count

重复次数,默认为0,反复重复。

Allow Duplicate Jobs = yesno

默认为no

Allow Higher Duplicates = yesno

默认为no

Cancel Lower Level Duplicates = yesno

默认为no

Cancel Queued Duplicates = yesno

默认为no

Cancel Running Duplicates = yesno

默认为no

DuplicateJobProximity = time-specification

见官方文档。

Run = job-name

见官方文档。

Priority = number

设置作业执行优先级,默认为10。数字越大,优先级越低。

Allow Mixed Priority = yesno

默认为no

Write Part After Job = yesno

默认为no

备份作业范例

Job {

Name = "ser1-backup"

Type = Backup

Level = Full

Client = ser1-fd

FileSet = "ser1-backup"

Messages = Standard

Pool = Default

Storage = File

Schedule = "OneDay"

Priority = 10

Write Bootstrap = "/usr/local/bacula/working/ser1-backup.bsr"

}

还原作业范例

Job {

Name = "ser1-restore"

Type = Restore

Client = ser1-fd

FileSet = "ser1-backup"

Storage = File

Pool = Default

Messages = Standard

Where = /opt/restore

Bootstrap = "/usr/local/bacula/working/ser1-backup.bsr"

}

 

定义时间周期使任务可以自动调度任务的执行,也可以覆盖Job{}的备份类型(Level),Pool{},Storage{}和Message{}的默认参数。当Job{}不引用它时,作业就只能手动运行。

Schedule{}部分的官方文档见The Schedule Resource

Name = name

指定Schedule{}名称,必选。

Run = Job-overrides Date-time-specification

指定覆盖Job{}默认参数的参数及执行作业的时间周期。

Job-overrides指定覆盖Job{}默认参数的参数,自定义一个特定的作业。例如,设置一个增量备份作业的Message{}定义为输出到一个文件,而每周或每月的完全备份作业的Message{}定义是发送不同邮件。

Level=Incremental

备份类型为Incremental

Pool=Weekly

引用Name值为Weekly的Pool{}

Storage= DLT_Drive

引用Name值为DLT_Drive的Storage{}

Messages=Verbose

引用Name值为Verbose的Messages{}

FullPool=Full

如果为完全备份作业,引用Name值为Full的Pool{}

DifferentialPool=Differential

如果为差异备份作业,引用Name值为Differential的Pool{}

IncrementalPool= Incremental

如果为增量备份作业,引用Name值为Incremental的Pool{}

SpoolData=yesno

见官方文档。

SpoolSize=bytes

见官方文档。

WritPartAfterJob=yesno

见官方文档。

Date-time-specification定义任务何时执行。关于时间设定规范建议查看详细的官方文档。

以下是关于官方文档的时间设定规范:

= on

= at

= 1st | 2nd | 3rd | 4th | 5th | first |

second | third | fourth | fifth

= sun | mon | tue | wed | thu | fri | sat |

sunday | monday | tuesday | wednesday |

thursday | friday | saturday

= w00 | w01 | ... w52 | w53

= jan | feb | mar | apr | may | jun | jul |

aug | sep | oct | nov | dec | january |

february | ... | december

= daily

= weekly

= monthly

= hourly

= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0

= |

<12hour> = 0 | 1 | 2 | ... 12

= 0 | 1 | 2 | ... 23

= 0 | 1 | 2 | ... 59

= 1 | 2 | ... 31

<12hour>:am |

<12hour>:pm

=

=

= -

= -

= -

= | |

= | |

= |

= | |

| |

|

|

= | |

=

针对时间设定规范中的一些词解释一下:

mday

月的某一天

wday

周的某一天

wom

月的某一周

woy

年的某一周

下面举例说明一下

范例:每天在2:05执行完全备份。

Schedule {

Name = "Daily"

Run = Level=Full daily at 2:05

}

范例:周日2:05执行完全备份,周一到周六2:05执行增量备份。

Schedule {

Name = "WeeklyCycle"

Run = Level=Full sun at 2:05

Run = Level=Incremental mon-sat at 2:05

}

范例:每月第一周的周日2:05执行完全备份,每月第二到第五周的周日2:05执行差异备份,周一到周六2:05执行增量备份。

Schedule {

Name = "MonthlyCycle"

Run = Level=Full Pool=Monthly 1st sun at 2:05

Run = Level=Differential 2nd-5th sun at 2:05

Run = Level=Incremental Pool=Daily mon-sat at 2:05

}

范例:每月1日2:05执行完全备份,其余日期2:05执行增量备份。

Schedule {

Name = "First"

Run = Level=Full on 1 at 2:05

Run = Level=Incremental on 2-31 at 2:05

}

范例:每10分钟执行完全备份。

Schedule {

Name = "TenMinutes"

Run = Level=Full hourly at 0:05

Run = Level=Full hourly at 0:15

Run = Level=Full hourly at 0:25

Run = Level=Full hourly at 0:35

Run = Level=Full hourly at 0:45

Run = Level=Full hourly at 0:55

}

 

Fileset{}定义哪些文件需要备份或者哪些文件排除在备份任务中,定义一个Fileset{}是每个备份任务必须的。可定义一个文件或者目录清单,可将压缩、加密和签名各种备份方案应用到每个文件。

Fileset{}部分的官方文档见The FileSet Resource,文档部分也引用了Victor’s CUBlog的文档。

Name = name

指定Fileset{}名称,必选。

Ignore FileSet Changes = yesno

默认为no。详细说明请参考官方文档

Enable VSS = yesno

是否启用卷影复制服务,默认为yes。此指令仅适用于启用VSS的有效的Win32文件守护进程。

Include { Options {file-options} ...; file-list }

Options { file-options }

Exclude { file-list }

设置客户端需要备份的文件及目录的路径,及备份方案。一个Fileset{}可包含多个Include{},一个Include{}可包含多个Options{}。下面再详细说明。

Include{}必须包含一个目录列表或文件。正常情况下,目录中的所有子目录及文件都会被备份。

客户端是Windows系统的备份文件路径以“/” 代替“\”,而且需要使用双引号括起来。例,需要备份C盘,路径则以”C:/”表示。

当文件路径存中在空格也需要使用双引号括起来。

以下Options{}参数的说明

compression=GZIP

使用GZIP6压缩格式备份文件

signature=SHA1

对备份文件加SHA1签名。据说比MD5算法慢,但是相对更安全。

signature=MD5

对备份文件添加MD5签名。Catalog数据库里将为每个文件多写大于16字节的MD5签名,推荐设置此参数。注意SHA1签名和MD5签名只允许使用一个。

basejob=options

The options letters specified are used when running a Backup Level=Full with BaseJobs. The options letters are the same than in the verify= option below.

accurate=options

The options letters specified are used when running a Backup Level=Incremental/Differential in Accurate mode. The options letters are the same than in the verify= option below.

verify=options

The options letters specified are used when running a Verify Level=Catalog as well as the DiskToCatalog level job. The options letters may be any combination of the following:

i compare the inodes

p compare the permission bits

n compare the number of links

u compare the user id

g compare the group id

s compare the size

a compare the access time

m compare the modification time (st_mtime)

c compare the change time (st_ctime)

d report file size decreases

5 compare the MD5 signature

1 compare the SHA1 signature

onefs=yesno

默认为yes,这个选项是指定Bacula备份分区时如果发现该分区里有不同的文件系统存在是否一起备份,yes不备份,no备份。如果你忘记了备份某个特别的分区(例如/dev,/proc,/net,/sys.....)这个选项会很有用,因为它会提醒你该分区里包含了什么不同分区。

如果你想备份多个文件系统或者要把某个分区连同该分区下挂载的nfs,samba数据(前提是没在exclude里定义的)都备份下来的话你可以设置no,但这样做有个弊端可能引起备份回环的问题发生,最好的设置是onefs=no ; fstype=ext2配合。

honor nodump flag=yesno

If your file system supports the nodump flag (e. g. most BSD-derived systems) Bacula will honor the setting of the flag when this option is set to yes. Files having this flag set will not be included in the backup and will not show up in the catalog. For directories with the nodump flag set recursion is turned off and the directory will be listed in the catalog. If the honor nodump flag option is not defined or set to no every file and directory will be eligible for backup.

portable=yesno

默认为no,如果为yes,Bacula将按照轻便的格式备份文件,以便尽可能多的保存WIN32系统的文件信息。

recurse=yesno

设置目录递归,默认为yes。

sparse=yesno

默认为no。这里是设置如果有稀疏的文件(直译)Bacula是否将zero字节的部分也备份下来,如果选no不检测sparse  file的话将备份文件空白的部分占用很多的磁带或卷空间,选yes检测的话就不备份空白字节,做到这点的代价是Bacula必须在备份前检查每个块备份速度将变慢。

readfifo=yesno

默认为no。

noatime=yesno

mtimeonly=yesno

默认为no。如果为yes,备份时将以文件修改时间为准;如果为no,则自动按照文件的修改时间或访问时间备份。

keepatime=yesno

默认为no。如果为yes,备份时将先备份文件的访问时间,恢复时也将保持文件的原有访问时间。

checkfilechanges=yesno

在2.0.4或更高版本,如果启用此项,客户端备份后将检查每个文件的大小、日期在备份过程中时候改变。如果大小或时间不匹配,将引发错误。建议启用此项。

错误举例:

zog-fd: Client1.2007-03-31_09.46.21 Error: /tmp/test mtime changed during backup.

hardlinks=yesno

默认yes,按照硬链接轨迹备份文件。如果硬链接过多将消耗大量CPU资源。

wild=string

指定字符串应用于文件名或目录名。请注意如果Exclude未启用,那么字符串将匹配被包括在内的文件;如果Exclude=yes,那么字符串将匹配被排除在外的文件。可以指定多个字符串;如果排除的是一个目录,那么下面的文件或目录将不做匹配。

wilddir=string

指定字符串应用于目录名,此参数不会匹配文件名。

wildfile=string

指定字符串应用于非目录。注意这个字符串匹配也适用于完整路径和文件名,那么指定字符串时注意文件名前面的路径。

regex=string

指定POSIX扩展正则表达式应用到文件名和目录名,也包括完整的路径。

建议使用简洁的语句,已节省CPU开销;使用双引号将字符串括起来。

regexfile=string

指定POSIX扩展正则表达式应用到非目录。

regexdir=string

指定POSIX扩展正则表达式应用到目录名。

exclude=yesno

默认为no。启用时,匹配的任何文件将不备份。

aclsupport=yesno

默认为no。如果系统安装libacl库支持ACL,Bacula会自动将支持acl编译进来。如果选择yes,备份和恢复时都会参考acl。注意,如果备份带有acl的ext3、xfs系统的文件或目录,恢复到一个不支持acl的系统例如reiserfs时acl将被忽略。

ignore case=yesno

默认为no,启用时,不区分大小写。

fstype=filesystem-type

指定文件和目录的文件系统,此参数不应用于WIN32系统。

在一个Options{}里允许你同时指定多个文件系统,如果你指定的文件系统与你要备份的分区不匹配将不会执行备份操作,这个指示常用在防止备份非本地的文件系统,按理说当你设置了这个指示后,你也将同时设置onefs=no以便bacula在文件系统中来回移动。

允许的文件系统类型包括:ext2, jfs, ntfs, proc, reiserfs, xfs, usbdevfs, sysfs, smbfs, iso9660. For ext3 systems, use ext2.

DriveType=Windows-drive-type

指定Windows驱动器的类型,此参数不应用于Unix/Linux系统。允许的值有:

removable, fixed, remote, cdrom, ramdisk

hfsplussupport=yesno

这个参数允许控制是否打开支持Mac OSX HFS plus插件。

strippath=integer

This option will cause integer paths to be stripped from the front of the full path/filename being backed up. This can be useful if you are migrating data from another vendor or if you have taken a snapshot into some subdirectory. This directive can cause your filenames to be overlayed with regular backup data, so should be used only by experts and with great care.

file-list

一个或多个文件或目录路径,使用’File=’开头。包含空格时,需要使用双引号。Wild-cards 应用于Options{},不应用于file-list

下面这些例子在file-list中比较特殊:

l 使用‘@’代替’File=’作为开头,‘@’后面为主控端的文件路径,而不是客户端的文件路径。例:

Include {

Options { compression=GZIP }

@/home/files/my-files

}

l ’File=’作为开头,使用‘|’后跟命令、脚本代替文件路径。详细见官方文档。

l ’File=’作为开头,使用‘<’后跟主控端文件路径。详细见官方文档。

l 使用设备、分区代替文件路径。此时也建议设置sparse=yes参数。例:

Include {

Options { signature=MD5; sparse=yes }

File = /dev/hd6

}

l If you explicitly specify a FIFO device name (created with mkfifo), and you add the option readfifo=yes as an option, Bacula will read the FIFO and back its data up to the Volume.详见官方文档。 For example:

Include {

Options {

signature=SHA1

readfifo=yes

}

File = /home/abc/fifo

}

l 使用ExcludeDirContaining = filename参数时,当目录中的文件符合filename值,那么此文件所在的目录将不备份。例:

# List of files to be backed up

FileSet {

Name = "MyFileSet"

Include {

Options {

signature = MD5

}

File = /home

Exclude Dir Containing = .excludeme

}

}

此时/home目录下有两个子目录中包含.excludeme的文件

/home/user/www/cache/.excludeme

/home/user/temp/.excludeme

那么这两个目录将不备份

/home/user/www/cache/

/home/user/temp/

以下是FileSet{}的范例

范例1:第一个Include备份所有/etc/backup.list里除了.Z和.gz的文件和目录,并GZIP压缩,SHA1签名,检测稀疏文件处理。第二个Include备份/root/myfile目录和/usr/lib/目录下的所有子目录和文件,但是*.o,*.exe文件除外。

FileSet {

  Name = "Full Set"

  Include {

    Options {

      Compression=GZIP

      signature=SHA1

      Sparse = yes

}

Options {

      wildfile = "*.Z"

      wildfile = "*.gz"

Exclude = yes

}

    @/etc/backup.list

  }

  Include {

     Options {

        wildfile = "*.o"

        wildfile = "*.exe"

        Exclude = yes

     }

     File = /root/myfile

     File = /usr/lib/

  }

}

范例2:备份整个系统

$ df

Filesystem 1k-blocks Used Available Use% Mounted on

/dev/hda5 5044156 439232 4348692 10% /

/dev/hda1 62193 4935 54047 9% /boot

/dev/hda9 20161172 5524660 13612372 29% /home

/dev/hda2 62217 6843 52161 12% /rescue

/dev/hda8 5044156 42548 4745376 1% /tmp

/dev/hda6 5044156 2613132 2174792 55% /usr

none 127708 0 127708 0% /dev/shm

//minimatou/c$ 14099200 9895424 4203776 71% /mnt/mmatou

lmatou:/ 1554264 215884 1258056 15% /mnt/matou

lmatou:/home 2478140 1589952 760072 68% /mnt/matou/home

lmatou:/usr 1981000 1199960 678628 64% /mnt/matou/usr

lpmatou:/ 995116 484112 459596 52% /mnt/pmatou

lpmatou:/home 19222656 2787880 15458228 16% /mnt/pmatou/home

lpmatou:/usr 2478140 2038764 311260 87% /mnt/pmatou/usr

deuter:/ 4806936 97684 4465064 3% /mnt/deuter

deuter:/home 4806904 280100 4282620 7% /mnt/deuter/home

deuter:/files 44133352 27652876 14238608 67% /mnt/deuter/files

考虑到/tmp、/proc,nfs,samba文件系统.journal;.autofsck应该排除,则设置如下:

FileSet {

Name = Include_example

Include {

Options {

wilddir = /proc

wilddir = /tmp

wildfile = "/.journal"

wildfile = "/.autofsck"

exclude = yes

}

File = /

File = /boot

File = /home

File = /rescue

File = /usr

}

}

范例3:只备份带有字母a和字母b的子目录

FileSet {

Name = "Full Set"

Include {

Options {

wilddir = "/home/a*"

wilddir = "/home/b*"

}

File = /home

}

}

范例4:排除c – z 开头的目录

FileSet {

Name = "Full Set"

Include {

Options {

RegexDir = "^/home/[c-z]"

exclude = yes

}

File = /home

}

}

范例5:备份一个分区或设备

FileSet {

Name = "RawPartition"

Include {

Options { sparse=yes }

File = /dev/hda2

}

}

范例6:备份Windows文件系统

FileSet {

  Name = "Windows 2000"

  Include {

    Options {

     signature = MD5

     IgnoreCase = yes

     # Exclude directories full of lots and lots of useless little files

     WildDir = "[A-Z]:/Documents and Settings/*/Cookies"

     WildDir = "[A-Z]:/Documents and Settings/*/Recent"

     Exclude = yes

    }

  File = "C:/"

  File = "D:/"

}

}

 

Client{}为主控端定义了所属客户端的属性,需要将每台需要备份的客户端都定义一个Client{}。The Client Resource

Name = name

指定Client{}名称,可设置为客户端计算机名-fd,有利于记忆。必选。

Address = address

指定客户端地址,可以是IP或者计算机名,如果选择计算机名,必须在/etc/hosts文件中加入解析条目,让系统能解析到此计算机名。必选。

FD Port = port-number

指定客户端监听端口号。默认为9102。

Catalog = Catalog-resource-name

引用Catalog{}的Name值,为客户端调用。必选。

Password = password

指定客户端的密码,出于安全原因,最好设置复杂密码,必选。

File Retention = time-period-specification

定义文件记录在Catalog数据库中的保留时间,不影响已存档的备份文件,需要设置AutoPrune = yes默认60天。

Job Retention = time-period-specification

定义任务记录在Catalog数据库中的保留时间,不影响已存档的备份文件,需要设置AutoPrune = yes默认6个月。

AutoPrune = yesno

是否自动修剪,默认为yes。

Maximum Concurrent Jobs = number

设置同时进行的作业最大数,默认为1。

Priority = number

设置客户端的优先级,可以设置1到1000,数字越小优先级越高。

范例

Client {

Name = ser1-fd

Address = ser1

FDPort = 9102

Catalog = MyCatalog

Password = "333" # password for FileDaemon

File Retention = 30 days # 30 days

Job Retention = 6 months # six months

AutoPrune = yes # Prune expired Jobs/Files

}

 

Storage {}为主控端定义了存储端的属性。至少存在一个存储端。

官方文档The Storage Resource

Name = name

指定Storage {}名称,必选。

Address = address

指定存储端的地址,可以是IP或者计算机名,如果选择计算机名,必须在/etc/hosts文件中加入解析条目,让系统能解析到此计算机名。必选。

SD Port = port

指定存储端的端口号,默认为9103。

Password = password

指定存储端的密码。出于安全原因,最好设置复杂密码,必选。

Device = device-name

指定存储的设备。引用存储端配置文件的Device{}的Name值,必选。

Media Type = MediaType

与存储端配置文件的Device{}的Media Type值相同,必选。详见官方文档。

Autochanger = yesno

默认为no,详见官方文档。

Maximum Concurrent Jobs = number

定义此存储端所允许同时进行的任务最大数量,默认为1。

AllowCompression = yesno

此存储端是否允许压缩,默认为yes,此参数可选。如果为no,那么将忽略Fileset{}中Options{}的compression参数。

Heartbeat Interval = time-interval

默认为0,可选。

范例

Storage {

Name = File

# Do not use "localhost" here

Address = ser1 # N.B. Use a fully qualified name here

SDPort = 9103

Password = "222"

Device = FileStorage

Media Type = File

}

 

Name = name

指定Catalog{}名称,必选。

password = password

指定数据库密码

DB Name = name

指定数据库名称

user = user

指定数据库用户

DB Address = address

指定数据库地址

DB Port = port

指定数据库端口号

范例

Catalog {

Name = MyCatalog

# Uncomment the following line if you want the dbi driver

# dbdriver = "dbi:mysql"; dbaddress = 127.0.0.1; dbport =

dbname = "bacula"; dbuser = "bacula"; dbpassword = ""

}

 

Name = name

指定Messages{}名称,必选。

MailCommand = command

设置发送邮件通知的指令

OperatorCommand = command

默认值

范例

Messages {

Name = Standard

mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"

operatorcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"

mail = root@localhost = all, !skipped

operator = root@localhost = mount

console = all, !skipped, !saved

append = "/usr/local/bacula/working/log" = all, !skipped

catalog = all

}

 

Name = name

指定Pool{}名称,必选。

Pool Type = type

指定Pool{}类型。

Storage = storage-resource-name

引用Storage {}的Name值

AutoPrune = yesno

是否自动修剪

Volume Retention = time-period-specification

Volume保留时间,默认为1年。

Recycle = yesno

是否重复使用Volume

范例

Pool {

Name = Default

Pool Type = Backup

Recycle = yes # Bacula can automatically recycle Volumes

AutoPrune = yes # Prune expired volumes

Volume Retention = 365 days # one year

}

 

此选项一般设置托盘监控相关参数

Name = name

指定Console{}名称,必选。

Password = password

指定Console{}密码,必选。

CommandACL = name-list

默认值

范例

Console {

Name = ser1-mon

Password = "444"

CommandACL = status, .status

}

 

#

# Default Bacula Director Configuration file

#

# The only thing that MUST be changed is to add one or more

# file or directory names in the Include directive of the

# FileSet resource.

#

# For Bacula release 5.0.1 (24 February 2010) -- redhat

#

# You might also want to change the default email address

# from root to your address. See the "mail" and "operator"

# directives in the Messages resource.

#

Director { # define myself

Name = ser1-dir

DIRport = 9101 # where we listen for UA connections

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

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

PidDirectory = "/usr/local/bacula/bin/working"

Maximum Concurrent Jobs = 1

Password = "111" # Console password

Messages = Daemon

}

JobDefs {

Name = "DefaultJob"

Type = Backup

Level = Incremental

Client = ser1-fd

FileSet = "Full Set"

Schedule = "WeeklyCycle"

Storage = File

Messages = Standard

Pool = File

Priority = 10

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

}

#

# Define the main nightly save backup job

# By default, this job will back up to disk in /tmp

Job {

Name = "BackupClient1"

JobDefs = "DefaultJob"

}

#Job {

# Name = "BackupClient2"

# Client = ser12-fd

# JobDefs = "DefaultJob"

#}

# Backup the catalog database (after the nightly save)

Job {

Name = "BackupCatalog"

JobDefs = "DefaultJob"

Level = Full

FileSet="Catalog"

Schedule = "WeeklyCycleAfterBackup"

# This creates an ASCII copy of the catalog

# Arguments to make_catalog_backup.pl are:

# make_catalog_backup.pl

RunBeforeJob = "/usr/local/bacula/bin/make_catalog_backup.pl MyCatalog"

# This deletes the copy of the catalog

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

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

Priority = 11 # run after main backup

}

#

# Standard Restore template, to be changed by Console program

# Only one such job is needed for all Jobs/Clients/Storage ...

#

Job {

Name = "RestoreFiles"

Type = Restore

Client=ser1-fd

FileSet="Full Set"

Storage = File

Pool = Default

Messages = Standard

Where = /tmp/bacula-restores

}

#localhost

Job {

Name = "ser1-backup"

Type = Backup

Level = Full

Client = ser1-fd

FileSet = "ser1-backup"

Messages = Standard

Pool = client-pool

Storage = File

Schedule = "OneDay"

Priority = 10

Write Bootstrap = "/usr/local/bacula/working/ser1-backup.bsr"

}

Job {

Name = "ser1-restore"

Type = Restore

Client = ser1-fd

FileSet = "ser1-backup"

Storage = File

Pool = client-pool

Messages = Standard

Where = /opt/restore

Bootstrap = "/usr/local/bacula/working/ser1-backup.bsr"

}

#redhat

Job {

Name = "redhat-backup"

Type = Backup

Level = Full

Client = redhat-fd

FileSet = "redhat-backup"

Messages = Standard

Pool = client-pool

Storage = File

Schedule = "OneDay"

Priority = 10

Write Bootstrap = "/usr/local/bacula/working/redhat-backup.bsr"

}

Job {

Name = "redhat-restore"

Type = Restore

Client = redhat-fd

FileSet = "redhat-backup"

Storage = File

Pool = client-pool

Messages = Standard

Where = /opt/restore

Bootstrap = "/usr/local/bacula/working/redhat-backup.bsr"

}

#sen-lenovo

Job {

Name = "sen-lenovo-backup"

Type = Backup

Level = Full

Client = sen-lenovo-fd

FileSet = "sen-lenovo-backup"

Messages = Standard

Pool = client-pool

Storage = File

Schedule = "OneDay"

Priority = 10

Write Bootstrap = "/usr/local/bacula/working/sen-lenovo-backup.bsr"

}

Job {

Name = "sen-lenovo-restore"

Type = Restore

Client = sen-lenovo-fd

FileSet = "sen-lenovo-backup"

Storage = File

Pool = client-pool

Messages = Standard

Where = /opt/restore

Bootstrap = "/usr/local/bacula/working/sen-lenovo-backup.bsr"

}

# List of files to be backed up

FileSet {

Name = "Full Set"

Include {

Options {

signature = MD5

}

File = /usr/local/bacula/bin

}

Exclude {

File = /usr/local/bacula/working

File = /tmp

File = /proc

File = /tmp

File = /.journal

File = /.fsck

}

}

#

# When to do the backups, full backup on first sunday of the month,

# differential (i.e. incremental since full) every other sunday,

# and incremental backups other days

Schedule {

Name = "WeeklyCycle"

Run = Full 1st sun at 23:05

Run = Differential 2nd-5th sun at 23:05

Run = Incremental mon-sat at 23:05

}

# This schedule does the catalog. It starts after the WeeklyCycle

Schedule {

Name = "WeeklyCycleAfterBackup"

Run = Full sun-sat at 23:10

}

# one day

Schedule {

Name = "OneDay"

Run = Level=Full daily at 18:18

}

# This is the backup of the catalog

FileSet {

Name = "Catalog"

Include {

Options {

signature = MD5

}

File = "/usr/local/bacula/working/bacula.sql"

}

}

#localhost

FileSet {

Name = "ser1-backup"

Include {

Options {

compression=GZIP

}

File = /ser1

}

}

#redhat

FileSet {

Name = "redhat-backup"

Include {

Options {

compression=GZIP

}

File = /redhat

}

}

#sen-lenovo

FileSet {

Name = "sen-lenovo-backup"

Include {

Options {

compression=GZIP

}

File = c:/sen-lenovo/

}

}

# Client (File Services) to backup

#ser1

Client {

Name = ser1-fd

Address = ser1

FDPort = 9102

Catalog = MyCatalog

Password = "333" # password for FileDaemon

File Retention = 30 days # 30 days

Job Retention = 6 months # six months

AutoPrune = yes # Prune expired Jobs/Files

}

#redhat

Client {

Name = redhat-fd

Address = redhat

FDPort = 9102

Catalog = MyCatalog

Password = "333" # password for FileDaemon

File Retention = 30 days # 30 days

Job Retention = 6 months # six months

AutoPrune = yes # Prune expired Jobs/Files

}

#sen-lenovo

Client {

Name = sen-lenovo-fd

Address = sen-lenovo

FDPort = 9102

Catalog = MyCatalog

Password = "333" # password for FileDaemon

File Retention = 30 days # 30 days

Job Retention = 6 months # six months

AutoPrune = yes # Prune expired Jobs/Files

}

# Definition of file storage device

Storage {

Name = File

# Do not use "localhost" here

Address = ser1 # N.B. Use a fully qualified name here

SDPort = 9103

Password = "222"

Device = FileStorage

Media Type = File

}

# Generic catalog service

Catalog {

Name = MyCatalog

dbname = "bacula"; dbuser = "bacula"; dbpassword = ""

}

# Reasonable message delivery -- send most everything to email address

# and to the console

Messages {

Name = Standard

mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: %t %e of %c %l\" %r"

operatorcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula: Intervention needed for %j\" %r"

mail = root@localhost = all, !skipped

operator = root@localhost = mount

console = all, !skipped, !saved

append = "/usr/local/bacula/working/log" = all, !skipped

catalog = all

}

#

# Message delivery for daemon messages (no job).

Messages {

Name = Daemon

mailcommand = "/usr/local/bacula/bin/bsmtp -h localhost -f \"\(Bacula\) \<%r\>\" -s \"Bacula daemon message\" %r"

mail = root@localhost = all, !skipped

console = all, !skipped, !saved

append = "/usr/local/bacula/working/log" = all, !skipped

}

# Default pool definition

Pool {

Name = Default

Pool Type = Backup

Recycle = yes # Bacula can automatically recycle Volumes

AutoPrune = yes # Prune expired volumes

Volume Retention = 365 days # one year

}

# File Pool definition

Pool {

Name = File

Pool Type = Backup

Recycle = yes # Bacula can automatically recycle Volumes

AutoPrune = yes # Prune expired volumes

Volume Retention = 365 days # one year

Maximum Volume Bytes = 50G # Limit Volume size to something reasonable

Maximum Volumes = 100 # Limit number of Volumes in Pool

}

# Scratch pool definition

Pool {

Name = Scratch

Pool Type = Backup

}

#client-pool

Pool {

Name = client-pool

Use Volume Once = yes

Pool Type = Backup

Recycle = yes # Bacula can automatically recycle Volumes

AutoPrune = yes # Prune expired volumes

Volume Retention = 365 days # one year

LabelFormat = "${Client}-storage-${Year}-${Month:p/2/0/r}-${Day:p/2/0/r}-id${JobId}"

}

#

# Restricted console used by tray-monitor to get the status of the director

#

Console {

Name = ser1-mon

Password = "444"

CommandACL = status, .status

}

 

设置连接主控端

Name = name

指定Director{}名称,设置主控端配置文件中Director{}的Name值,必选。

Password = password

指定主控端配置文件Storage{}的Password值,必选。

连接主控端设置范例

Director {

Name = ser1-dir

Password = "222"

}

托盘监控相关设置

Name = name

指定Director{}名称,设置托盘监控配置文件中Monitor{}的Name值,必选。

Password = password

指定托盘监控配置文件中Storage{}的Password值,必选。

Monitor = yesno

是否开启监控。默认值no

托盘监控相关设置范例

Director {

Name = ser1-mon

Password = "444"

Monitor = yes

}

 

Name = name

指定Storage{}名称,必选。

Working Directory = Directory

指定工作目录,目录必须已经存在,必选。一般在./configure时已经指定。

Pid Directory = Directory

指定进程ID文件存放目录,必选。一般在./configure时已经指定。

SDAddresses = IP-address-specification

指定地址和端口监听主控端连接,详细用法可查看官方文档(Storage Resource)。

SDPort = port-number

指定端口监听主控端连接,默认是9103。不与SDAddresses参数同时使用。

SDAddress = IP-Address

指定地址监听主控端连接,可选。如果它被指定,那么此地址将与存储端绑定;如果未指定将绑定到本机当前使用的地址。只允许指定一个地址。不与SDAddresses参数同时使用。

Maximum Concurrent Jobs = number

设置同时执行的最大任务数量,默认设置为10。

Client Connect Wait = time-interval

客户端连接超时时间。默认为30分钟。

Heartbeat Interval = time-interval

可选。

范例

Storage { # definition of myself

Name = ser1-sd

SDPort = 9103 # Director's port

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

Pid Directory = "/usr/local/bacula/bin/working"

Maximum Concurrent Jobs = 20

}

 

Name = Device-Name

指定Device{}的名称,必选。

Archive Device = name-string

指定存储设备的路径,可以使磁带驱动器,也可以是一个目录名,必选。

Device Type = type-specification

指定该设备的类型。文件、磁带或DVD。

Media Type = name-string

默认值。

Autochanger = yesno

是否自动更换设备,默认为No。如果是yes,设备必须能自动更换磁带。

Maximum Concurent Jobs = number

设置最大Job连接数

Always Open = yesno

设置设备是否始终保持可用。如果是磁带强烈建议设置为yes;如果是文件存储,设置为no,在需要时自动打开。

Removable media = yesno

可移动媒体支持,默认为no。

Random access = yesno

是否随机存取,默认为yes。如果设备是usb的DVD及所有的文件系统则设置为yes;如果是磁带则为no。

范例

Device {

Name = FileStorage

Media Type = File

Archive Device = /opt/backup

LabelMedia = yes; # lets Bacula label unlabeled media

Random Access = Yes;

AutomaticMount = yes; # when device opened, read it

RemovableMedia = no;

AlwaysOpen = no;

}

 

此选项不再做介绍,与主控端配置文件的Messages{}的用法一样,可供参考。

贴一下范例

Messages {

Name = Standard

director = ser1-dir = all

}

 

#

# Default Bacula Storage Daemon Configuration file

#

# For Bacula release 5.0.1 (24 February 2010) -- redhat

#

# You may need to change the name of your tape drive

# on the "Archive Device" directive in the Device

# resource. If you change the Name and/or the

# "Media Type" in the Device resource, please ensure

# that dird.conf has corresponding changes.

#

Storage { # definition of myself

Name = ser1-sd

SDPort = 9103 # Director's port

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

Pid Directory = "/usr/local/bacula/bin/working"

Maximum Concurrent Jobs = 20

}

#

# List Directors who are permitted to contact Storage daemon

#

Director {

Name = ser1-dir

Password = "222"

}

Director {

Name = ser1-mon

Password = "444"

Monitor = yes

}

Device {

Name = FileStorage

Media Type = File

Archive Device = /opt/backup

LabelMedia = yes; # lets Bacula label unlabeled media

Random Access = Yes;

AutomaticMount = yes; # when device opened, read it

RemovableMedia = no;

AlwaysOpen = no;

}

Messages {

Name = Standard

director = ser1-dir = all

}

 

设置连接主控端

Name = name

指定Director{}名称,设置主控端配置文件中Director{}的Name值,必选。

Password = password

指定主控端配置文件Clinet{}的Password值,必选。

连接主控端设置范例

Director {

Name = ser1-dir

Password = "333"

}

托盘监控相关设置

Name = name

指定Director{}名称,设置托盘监控配置文件中Monitor{}的Name值,必选。

Password = password

指定托盘监控配置文件中Client{}的Password值,必选。

Monitor = yesno

是否开启监控。默认值no

托盘监控相关设置范例

Director {

Name = ser1-mon

Password = "444"

Monitor = yes

}

 

Name = name

指定FileDaemon{}名称,必选。

Working Directory = Directory

指定工作目录,目录必须已经存在,必选。一般在./configure时已经指定。

Pid Directory = Directory

指定进程ID文件存放目录,必选。一般在./configure时已经指定。

Heartbeat Interval = time-interval

可选。

Maximum Concurrent Jobs = number

设置同时执行的最大任务数量,默认设置为2。

FDAddresses = IP-address-specification

指定地址和端口监听主控端连接,详细用法可查看官方文档(Client/File daemon Configuration)。

FDPort = port-number

指定端口监听主控端连接,默认是9102。不与FDAddresses参数同时使用。

FDAddress = IP-Address

指定地址监听主控端连接,可选。如果它被指定,那么此地址将与客户端端绑定;如果未指定将绑定到本机当前使用的地址。只允许指定一个地址。不与FDAddresses参数同时使用。

FDSourceAddress = IP-Address

指定地址监听存储端连接,可选。如果它被指定,那么此地址将与客户端端绑定;如果未指定将根据默认路由表。

SDConnectTimeout = time-interval

指定连接到存储端的超时时间,默认为30分钟。

范例

FileDaemon { # this is me

Name = ser1-fd

FDport = 9102 # where we listen for the director

WorkingDirectory = /usr/local/bacula/working

Pid Directory = /usr/local/bacula/bin/working

Maximum Concurrent Jobs = 20

}

 

此选项不再做介绍,与主控端配置文件的Messages{}的用法一样,可供参考。

贴一下范例

Messages {

Name = Standard

director = ser1-dir = all, !skipped, !restored

}

 

#

# Default Bacula File Daemon Configuration file

#

# For Bacula release 5.0.1 (24 February 2010) -- redhat

#

# There is not much to change here except perhaps the

# File daemon Name to

#

#

# List Directors who are permitted to contact this File daemon

#

Director {

Name = ser1-dir

Password = "333"

}

#

# Restricted Director, used by tray-monitor to get the

# status of the file daemon

#

Director {

Name = ser1-mon

Password = "444"

Monitor = yes

}

#

# "Global" File daemon configuration specifications

#

FileDaemon { # this is me

Name = ser1-fd

FDport = 9102 # where we listen for the director

WorkingDirectory = /usr/local/bacula/working

Pid Directory = /usr/local/bacula/bin/working

Maximum Concurrent Jobs = 20

}

# Send all messages except skipped files back to Director

Messages {

Name = Standard

director = ser1-dir = all, !skipped, !restored

}

 

有配置文件中控制台的配置文件是最简单的。一般情况下,除了更改密码,其他均不需要更改。它负责连接主控端。

Name = name

指定主控端名称。设置主控端配置文件中Director{}的Name值,必选。

DIRPort = port-number

指定主控端端口号,默认为9101。

Address = address

指定主控端地址。可以是IP或者计算机名,如果选择计算机名,必须在/etc/hosts文件中加入解析条目,让系统能解析到此计算机名。必选。

Password = password

指定主控端密码。设置主控端配置文件中Director{}的Password值,必选。

范例

Director {

Name = ser1-dir

DIRport = 9101

address = ser1

Password = "111"

}

 

如果你使用GNOME版本的控制台,就可以使用此选项定义窗口的字体。

可选,不必指定。

Name = name

指定ConsoleFont{}名称。必选

Font = Pango Font Name

指定了Pango格式的字体,默认为

Font = "LucidaTypewriter 9"

范例

ConsoleFont {

Name = Default

Font = "Monospace 10"

}

 

可以为控制台设置不同的安全级别。详细可参考官方文档(Console Configuration)。

可选,不必指定。

#

# Bacula User Agent (or Console) Configuration File

#

Director {

Name = ser1-dir

DIRport = 9101

address = ser1

Password = "111"

}

 

Name = name

指定Monitor{}名称。用于连接到主控端、存储端及客户端,必选。

Password = password

设置与控制台配置文件Console{}的Password值相同,必选。

Refresh Interval = time

刷新间隔时间默认为5秒,不能超过10分钟,小于1秒。

 

Name = name

指定Director{}名称,此名称显示在监控进程的列表里,必选。

DIRPort = port-number

指定主控端端口号,默认9101。

Address = address

指定主控端地址。可以是IP或者计算机名,如果选择计算机名,必须在/etc/hosts文件中加入解析条目,让系统能解析到此计算机名。必选。

 

Name = name

指定Storage{}名称,此名称显示在监控进程的列表里,必选。

Address = address

指定存储端地址。可以是IP或者计算机名,如果选择计算机名,必须在/etc/hosts文件中加入解析条目,让系统能解析到此计算机名。必选。

SD Port = port

指定存储端端口号,默认9103。

Password = password

指定存储端监控端口号,必选。

 

Name = name

指定Client{}名称,此名称显示在监控进程的列表里,必选。

Address = address

指定客户端地址。可以是IP或者计算机名,如果选择计算机名,必须在/etc/hosts文件中加入解析条目,让系统能解析到此计算机名。必选。

FD Port = port-number

指定存储端端口号,默认9102。

Password = password

指定客户端监控端口号,必选。

 

#

# Bacula Tray Monitor Configuration File

#

Monitor {

Name = ser1-mon

Password = "444" # password for the Directors

RefreshInterval = 5 seconds

}

Client {

Name = ser1-fd

Address = ser1

FDPort = 9102

Password = "444" # password for FileDaemon

}

Storage {

Name = ser1-sd

Address = ser1

SDPort = 9103

Password = "444" # password for StorageDaemon

}

Director {

Name = ser1-dir

DIRport = 9101

address = ser1

}

为了更好理解,下面贴一下主控端、存储端及客户端的配置文件范例

主控端配置文件关于监控相关设置

#

# Restricted console used by tray-monitor to get the status of the director

#

Console {

Name = ser1-mon

Password = "444"

CommandACL = status, .status

}

存储端配置文件关于监控相关设置

Director {

Name = ser1-mon

Password = "444"

Monitor = yes

}

客户端配置文件关于监控相关设置

#

# Restricted Director, used by tray-monitor to get the

# status of the file daemon

#

Director {

Name = ser1-mon

Password = "444"

Monitor = yes

}

 

Bacula

启动Bacula服务之前,可以先测试一下对应的配置文件是否有错误,如下

# cd /usr/local/bacula/bin

# ./bacula-dir -t -c bacula-dir.conf

#./bacula-fd -t -c bacula-fd.conf

#./bacula-sd -t -c bacula-sd.conf

#./bconsole -t -c bconsole.conf

#./bwx-console -t -c bwx-console.conf

#./bat -t -c bat.conf

# su -c "./bacula-tray-monitor -t -c tray-monitor.conf"

启动主控端服务

# /etc/init.d/bacula-dir start

启动客户端服务。Windows Bacula客户端服务名称Bacula-fd(Bacula File Service)

# /etc/init.d/bacula-fd start

启动存储端服务

# /etc/init.d/bacula-sd start

一步启动|关闭|重启|状态Bacula三个服务

# /usr/local/bacula/bin/bacula start|stop|restart|status

查看Bacula是否处于监听状态

# netstat –an |grep 910

bacula-dir 9101

bacula-fd 9102

bacula-sd 9103



文档下载 Bacula 配置.pdf   

阅读(5960) | 评论(2) | 转发(2) |
0

上一篇:Bacula 安装

下一篇:Bacula 管理

给主人留下些什么吧!~~

mxs8102015-08-10 11:56:11

真心不错,谢谢博主的无私奉献

市井一布衣2013-08-14 17:23:06

很好的博文