一、bacula的备份恢复过程之完全备份。
1.创建卷组

连接到bacula的控制端,执行备份恢复操作
[root@baculaserver etc]# /usr/local/bacula/sbin/bconsole
Connecting to Director 192.168.137.194:9101
1000 OK: baculaserver.test.com-dir Version: 5.2.6 (21 February 2012)
Enter a period to cancel a command.
*label
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Automatically selected Storage: dbsd
Enter new Volume name: cicro4
Automatically selected Pool: dbpool
Connecting to Storage daemon dbsd at 192.168.137.194:9103 ...
Sending label command for Volume "cicro4" Slot 0 ...
3000 OK label. VolBytes=222 DVD=0 Volume="cicro4" Device="dbdev" (/data/webdata)
Catalog record for Volume "cicro4", Slot 0  successfully created.
Requesting to mount dbdev ...
3906 File device ""dbdev" (/data/webdata)" is always mounted.

2.利用run命令执行备份操作
*run
A job name must be specified.
The defined Job resources are:
     1: Client1
     2: Client
     3: BackupCatalog
     4: RestoreFiles
Select Job resource (1-4): 1
Run Backup job
JobName:  Client1
Level:    Incremental
Client:   dbfd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2013-04-14 14:37:01
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=1

到此为止,可以开始备份,bacula-dir.conf配置文件中定义的Client1是一个增量备份,但是由于是第一次备份所以会做一个完全备份,第二次才会增量备份。

3.查看备份状态
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 1
baculaserver.test.com-dir Version: 5.2.6 (21 February 2012) x86_64-unknown-linux-gnu redhat
Daemon started 14-Apr-13 14:33. Jobs: run=1, running=0 mode=0,0
 Heap: heap=278,528 smbytes=77,452 max_bytes=91,121 bufs=251 max_bufs=287

Scheduled Jobs:
Level          Type     Pri  Scheduled          Name               Volume
===================================================================================
Differential   Backup    10  14-Apr-13 23:05    Client1            cicro4
Differential   Backup    10  14-Apr-13 23:05    Client             cicro4
Differential   Backup    10  14-Apr-13 23:05    BackupCatalog      cicro4
====

Running Jobs:
Console connected at 14-Apr-13 14:34
No Jobs running.
====

Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
====================================================================
     1  Full          3    4.035 M  OK       14-Apr-13 14:37 Client1

====

由于这里bacula将备份SD和控制端(DIR)在同一台服务器上,因此可以用过选项1来查看SD的状态
如果SD和控制端(DIR)不在同一台服务器上,要使用选项2来查看

到这里可以看出JobId 为1的 备份是一个完全备份,备份的数据文件有3个,大小为4.035M
备份完成时间为14-Apr-13 14:37。还可以通过Scheduled Jobs: 看出会在今天晚上23:05分做一次
增量备份。

如果利用run命令再次运行一次备份的话 我们查看状态,
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 1
baculaserver.test.com-dir Version: 5.2.6 (21 February 2012) x86_64-unknown-linux-gnu redhat
Daemon started 14-Apr-13 14:33. Jobs: run=2, running=0 mode=0,0
 Heap: heap=278,528 smbytes=79,966 max_bytes=93,635 bufs=252 max_bufs=288

Scheduled Jobs:
Level          Type     Pri  Scheduled          Name               Volume
===================================================================================
Differential   Backup    10  14-Apr-13 23:05    Client1            cicro4
Differential   Backup    10  14-Apr-13 23:05    Client             cicro4
Differential   Backup    10  14-Apr-13 23:05    BackupCatalog      cicro4
====

Running Jobs:
Console connected at 14-Apr-13 14:34
No Jobs running.
====

Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
====================================================================
     1  Full          3    4.035 M  OK       14-Apr-13 14:37 Client1
     2  Incr      1,882    7.625 M  OK       14-Apr-13 14:49 Client1

====

我们发现JobId为2的备份为一次增量备份。

4.差异备份功能
 执行备份,Client为我们在bucala-dir.conf中定义的。
*run
A job name must be specified.
The defined Job resources are:
     1: Client1
     2: Client
     3: BackupCatalog
     4: RestoreFiles
Select Job resource (1-4): 2
Run Backup job
JobName:  Client
Level:    Differential
Client:   dbfd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2013-04-14 14:55:48
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=3
You have messages.

查看备份状态。
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 1
baculaserver.test.com-dir Version: 5.2.6 (21 February 2012) x86_64-unknown-linux-gnu                                                                                    redhat
Daemon started 14-Apr-13 14:33. Jobs: run=3, running=0 mode=0,0
 Heap: heap=278,528 smbytes=87,502 max_bytes=96,019 bufs=264 max_bufs=289

Scheduled Jobs:
Level          Type     Pri  Scheduled          Name               Volume
===================================================================================
Differential   Backup    10  14-Apr-13 23:05    Client1            cicro4
Differential   Backup    10  14-Apr-13 23:05    Client             cicro4
Differential   Backup    10  14-Apr-13 23:05    BackupCatalog      cicro4
====

Running Jobs:
Console connected at 14-Apr-13 14:34
Console connected at 14-Apr-13 14:56
No Jobs running.
====

Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
====================================================================
     1  Full          3    4.035 M  OK       14-Apr-13 14:37 Client1
     2  Incr      1,882    7.625 M  OK       14-Apr-13 14:49 Client1
     3  Full      1,885    15.69 M  OK       14-Apr-13 14:55 Client

====
可以看到JobId为3的备份任务名字为Client,是一个完全备份。

在执行以下操作前我们在FD客户端需要备份的目录下增加一个文件。

再次运行备份

*run
A job name must be specified.
The defined Job resources are:
     1: Client1
     2: Client
     3: BackupCatalog
     4: RestoreFiles
Select Job resource (1-4): 2
Run Backup job
JobName:  Client
Level:    Differential
Client:   dbfd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2013-04-14 14:58:43
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=4
You have messages.

查看状态

*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 1
baculaserver.test.com-dir Version: 5.2.6 (21 February 2012) x86_64-unknown-linux-gnu redhat
Daemon started 14-Apr-13 14:33. Jobs: run=4, running=0 mode=0,0
 Heap: heap=278,528 smbytes=100,173 max_bytes=113,842 bufs=277 max_bufs=313

Scheduled Jobs:
Level          Type     Pri  Scheduled          Name               Volume
===================================================================================
Differential   Backup    10  14-Apr-13 23:05    Client1            cicro4
Differential   Backup    10  14-Apr-13 23:05    Client             cicro4
Differential   Backup    10  14-Apr-13 23:05    BackupCatalog      cicro4
====

Running Jobs:
Console connected at 14-Apr-13 14:34
Console connected at 14-Apr-13 14:56
No Jobs running.
====

Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
====================================================================
     1  Full          3    4.035 M  OK       14-Apr-13 14:37 Client1
     2  Incr      1,882    7.625 M  OK       14-Apr-13 14:49 Client1
     3  Full      1,885    15.69 M  OK       14-Apr-13 14:55 Client
     4  Diff          2    4.035 M  OK       14-Apr-13 14:58 Client

====

可以看到JobId为4,名字为Client的任务是一个差异备份。

5.bacula的完全备份数据恢复

我们通过上面的状态可以知道JobId为3的任务是一个完全备份
*restore

First you select one or more JobIds that contain files
to be restored. You will be presented several methods
of specifying the JobIds. Then you will be allowed to
select which files from those JobIds are to be restored.

To select the JobIds, you have the following choices:
     1: List last 20 Jobs run
     2: List Jobs where a given File is saved
     3: Enter list of comma separated JobIds to select
     4: Enter SQL list command
     5: Select the most recent backup for a client
     6: Select backup for a client before a specified time
     7: Enter a list of files to restore
     8: Enter a list of files to restore before a specified time
     9: Find the JobIds of the most recent backup for a client
    10: Find the JobIds for a backup for a client before a specified time
    11: Enter a list of directories to restore for found JobIds
    12: Select full restore to a specified Job date
    13: Cancel
Select item:  (1-13): 3
Enter JobId(s), comma separated, to restore: 3,4
You have selected the following JobIds: 3,4
#这里仅仅指定 差异备份的一个完全备份和差异备份的JobId就可以恢复数据
Building directory tree for JobId(s) 3,4 ...  +++++++++++++++++++++++++++++++++++++++++++++
1,745 files inserted into the tree.

You are now entering file selection mode where you add (mark) and
remove (unmark) files to be restored. No files are initially added, unless
you used the "all" keyword on the command line.
Enter "done" to leave this mode.

cwd is: /
$ mark *
1,886 files marked.
$ done
Bootstrap records written to /usr/local/bacula/var/bacula/working/baculaserver.test.com-dir.restore.1.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================

cicro4                    dbsd                      dbdev

Volumes marked with "*" are online.

1,886 files selected to be restored.

Defined Clients:  #指定恢复到那个FD上去
     1: dbfd
     2: dbfs1
Select the Client (1-2): 1
Run Restore job
JobName:         RestoreFiles
Bootstrap:       /usr/local/bacula/var/bacula/working/baculaserver.test.com-dir.restore.1.bsr
Where:           /data/bacula-Restores
Replace:         always
FileSet:         dbfs
Backup Client:   dbfd
Restore Client:  dbfd
Storage:         dbsd
When:            2013-04-14 15:10:41
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no): mod
Parameters to modify:
     1: Level
     2: Storage
     3: Job
     4: FileSet
     5: Restore Client
     6: When
     7: Priority
     8: Bootstrap
     9: Where
    10: File Relocation
    11: Replace
    12: JobId
    13: Plugin Options
Select parameter to modify (1-13): 9
Please enter path prefix for restore (/ for none): /
Run Restore job
JobName:         RestoreFiles
Bootstrap:       /usr/local/bacula/var/bacula/working/baculaserver.test.com-dir.restore.1.bsr
Where:
Replace:         always
FileSet:         dbfs
Backup Client:   dbfd
Restore Client:  dbfd
Storage:         dbsd
When:            2013-04-14 15:10:41
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no): yes
Job queued. JobId=5
*

6.增量备份恢复,增量备份的恢复我们只需要在Enter JobId(s), comma separated, to restore: 这一行
填入我们第一次完全备份的JobId号后后面每次增量备份的JobId号即可。

转载于:https://blog.51cto.com/qq15570453/1178010

开源网络备份软件bacula数据恢复(二)相关推荐

  1. 开源网络备份软件bacula学习笔记

    bacula总体概述 (高性能linux服务器架构)  1.1 bacula是什么   Bacula是一款开源的跨平台网络备份工具,它提供基于企业级的客户端和服务器的备份和恢复解决方案.  1.2 b ...

  2. 开源网络备份软件bacula(安装bacula)

    一. bacula的几种网络备份拓扑      前面文章介绍了bacula有5个组成部分,在实际的应用中,没有必要将5个部分分别放在不同的服务器上,它们之间的某些部分是可以合并的,常见的bacula部 ...

  3. 关于bacula网络备份软件的安装以及配置1

    最近在网上看到有一个强大的网络备份软件bacula,于是就找了一些资料来看,发现网上的资料寥寥无几啊,凭着自己的理解就在本地环境下面进行了测试,最后终于实现了网络的备份以及还原功能,当然此文章也有不足 ...

  4. 如何选择合适的网络备份软件

    为什么需要网络备份软件 技术能力的增长和业务的扩展对网络管理产生了重大影响.维持业务运转的网络比以往任何时候都大,成为由交换机.路由器.服务器和其他设备组成的复杂网络.拥有技能和工具的 IT 运营团队 ...

  5. linux服务器备份软件下载,五大Linux开源服务器备份软件

    (转载:www.idcew.com) 当世界开始广泛采用你早就知道是优越的东西时,这是令人欣慰的.这是大多数Linux爱好者的感受;在过去的几年里,这个平台变得越来越受欢迎,这意味着越来越多的开源软件 ...

  6. 关于bacula网络备份软件的安装以及配置3

    现在去看看备份路径下面是否生成了备份文件<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office ...

  7. 网络可视化 | 虹科网络监控软件解决方案(二)-- 网络探针nProbe

    在商业环境中,NetFlow可能是网络流量统计的事实标准.nProbe包括NetFlow v5 / v9 / IPFIX探针和收集器,可用于处理NetFlow流.这意味着可以使用nProbe™: 收集 ...

  8. 开源网络准入软件packetfence 部署心得-1

    packetfence 是一款内网准入软件,刚开始研究的时候也是一脸懵逼,资料少的可怜,前后玩了几个月,中途很多次都想放弃了,填完了很多坑,最后也算是成功了 好了,今天就讲一下packetfence所 ...

  9. 几款著名的免费、开源网络监控软件

    一.Zabbix:www.zabbix.com 1.基本情况: ALL IN ONE SOLUTION True Open Source software Performance monitoring ...

最新文章

  1. python项目之网络聊天室_Python实现多人聊天室
  2. webview重新加载(reload)或者发起 redirect request导致js和objc代码之间的bridge失联解决方案(亲测有效)...
  3. C#上位机软件串口数据接收用Invoke(同步)和BeginInvoke(异步)的区别
  4. javascript---》arguments对象
  5. Java for LeetCode 061 Rotate List
  6. 把一个结构体当做属性后碰到的问题
  7. 华为云专线接入方案介绍
  8. jQuery之事件绑定到触发全过程及知识点补充
  9. 书单丨把握Java技术发展的新趋势!
  10. JS正则表达式从入门到入土(7)—— 分组
  11. Atitit。监听键盘上下左右方向键事件java js jquery c#.net
  12. 网站可行性报告范文_孝感做可行性报告本地立项范文
  13. 搜索在线设备的工具软件-SADPTool提供下载
  14. 2020爱站网突然关闭,站长们现在用啥工具分析数据了?
  15. 五年级上册用计算机探索规律思维导图,五年级上册数学第一单元思维导图 包括小数乘整数小数乘小数积的...
  16. Qt设计师的简单使用(ui设计界面的简单使用)
  17. php 去高去低去平均值,招标评分必备,去掉最高最低分求平均值
  18. 读书笔记《蛤蟆先生去看心理医生》
  19. 考研数学第三章复习:曲率、曲率圆、曲率半径
  20. carsim与simulink联合仿真-ABS(制动防抱死系统) 入门——详细步骤

热门文章

  1. 【转】几种页面重定向代码总结
  2. Flink Window基本概念与实现原理
  3. 苹果布局大数据,两亿美元收购暗数据企业
  4. C语言操作SQLite数据库
  5. 关于github failed to push some refs
  6. 基于vue-cli,做个nuxt脚手架~
  7. 在MyEclipse中使用maven创建web项目
  8. Android端WEEX + HTTPDNS 最佳实践
  9. percona xtrabackupd定期做全备,增量备份shell脚本
  10. IGMP V1 V2 V3 定义和区别