如何部署Bareos备份3-使用控制台

Bareos

3 使用备份控制台

In Server

3.1 bconsole的基本指令

3.1.1 启动bconsole

[root@bareos]# bconsole
Connecting to Director localhost:9101
1000 OK: bareos-dir Version: 16.2.4 (01 July 2016)
Enter a period to cancel a command.
*

3.1.2 命令行帮助

*help

3.1.3 显示要备份的文件

*show filesets

3.1.4 显示调度器状态

*status dir

3.1.5 显示要备份的客户端

*status client

3.1.6 显示备份存储状态

*status storage

3.1.7 退出控制台

quit

3.2 bconsole运行作业

3.2.1 运行作业

*run

向导如下:

A job name must be specified.
The defined Job resources are:
     1: RestoreFiles
     2: BackupCatalog
     3: backup-bareos-fd
Select Job resource (1-3): 3
Run Backup job
JobName:  backup-bareos-fd
Level:    Incremental
Client:   bareos-fd
Format:   Native
FileSet:  SelfTest
Pool:     Incremental (From Job IncPool override)
Storage:  File (From Job resource)
When:     2017-08-29 04:51:32
Priority: 10
OK to run? (yes/mod/no): yes

3.2.2 查阅作业信息

*messages

信息显示如下:

29-Aug 05:01 bareos-dir JobId 1: No prior Full backup Job record found.
29-Aug 05:01 bareos-dir JobId 1: No prior or suitable Full backup found in catalog. Doing FULL backup.
29-Aug 05:01 bareos-dir JobId 1: Start Backup JobId 1, Job=backup-bareos-fd.2017-08-29_05.01.45_44
29-Aug 05:01 bareos-dir JobId 1: Created new Volume "Full-0001" in catalog.
29-Aug 05:01 bareos-dir JobId 1: Using Device "FileStorage" to write.
29-Aug 05:01 bareos-sd JobId 1: Labeled new Volume "Full-0001" on device "FileStorage" (/var/lib/bareos/storage).
29-Aug 05:01 bareos-sd JobId 1: Wrote label to prelabeled Volume "Full-0001" on device "FileStorage" (/var/lib/bareos/storage)
29-Aug 05:01 bareos-sd JobId 1: Elapsed time=00:00:02, Transfer rate=104.5 M Bytes/second
29-Aug 05:01 bareos-dir JobId 1: Bareos bareos-dir 16.2.4 (01Jul16):
  Build OS:               x86_64-redhat-linux-gnu redhat CentOS Linux release 7.0.1406 (Core)
  JobId:                  1
  Job:                    backup-bareos-fd.2017-08-29_05.01.45_44
  Backup Level:           Full (upgraded from Incremental)
  Client:                 "bareos-fd" 16.2.4 (01Jul16) x86_64-redhat-linux-gnu,redhat,CentOS Linux release 7.0.1406 (Core) ,CentOS_7,x86_64
  FileSet:                "SelfTest" 2017-08-29 05:01:45
  Pool:                   "Full" (From Job FullPool override)
  Catalog:                "MyCatalog" (From Client resource)
  Storage:                "File" (From Job resource)
  Scheduled time:         29-Aug-2017 04:59:18
  Start time:             29-Aug-2017 05:01:47
  End time:               29-Aug-2017 05:01:49
  Elapsed time:           2 secs
  Priority:               10
  FD Files Written:       459
  SD Files Written:       459
  FD Bytes Written:       209,051,890 (209.0 MB)
  SD Bytes Written:       209,098,847 (209.0 MB)
  Rate:                   104525.9 KB/s
  Software Compression:   None
  VSS:                    no
  Encryption:             no
  Accurate:               no
  Volume name(s):         Full-0001
  Volume Session Id:      1
  Volume Session Time:    1503988337
  Last Volume Bytes:      209,266,948 (209.2 MB)
  Non-fatal FD errors:    0
  SD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Backup OK

3.2.3 等待作业完成

*wait jobid=1

3.2.4 备份的位置

ls -l /var/lib/bareos/storage/

3.2.5 恢复备份

*restore all

向导如下:

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): 5
Automatically selected Client: bareos-fd
Automatically selected FileSet: SelfTest
+-------+-------+----------+-------------+---------------------+------------+
| JobId | Level | JobFiles | JobBytes    | StartTime           | VolumeName |
+-------+-------+----------+-------------+---------------------+------------+
|     1 | F     |      459 | 209,051,890 | 2017-08-29 05:01:47 | Full-0001  |
+-------+-------+----------+-------------+---------------------+------------+
You have selected the following JobId: 1

Building directory tree for JobId(s) 1 ...  +++++++++++++++++++++++++++++++++++++++++++++
458 files inserted into the tree and marked for extraction.

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: /

基于以上,我们可以检索我们要恢复的文件

cd /
dir
cd /usr/sbin
dir

要继续恢复或退出,请输入:

$ done

向导如下:

Bootstrap records written to /var/lib/bareos/bareos-dir.restore.2.bsr

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

    Full-0001                 File                      FileStorage

Volumes marked with "*" are online.


459 files selected to be restored.

Using Catalog "MyCatalog"
Run Restore job
JobName:         RestoreFiles
Bootstrap:       /var/lib/bareos/bareos-dir.restore.2.bsr
Where:           /tmp/bareos-restores
Replace:         Always
FileSet:         LinuxAll
Backup Client:   bareos-fd
Restore Client:  bareos-fd
Format:          Native
Storage:         File
When:            2017-08-29 21:05:16
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no): yes
Job queued. JobId=5
You have messages.

文件将被恢复到以下目录

ls -l /tmp/bareos-restores/

注:你需要手动还原文件并清理恢复

rm -rf /tmp/bareos-restores/

===========================================================
官方文档
————-
https://github.com/bareos/bareos-docs
http://doc.bareos.org/master/html/bareos-manual-main-reference.html

官方源
————-
http://download.bareos.org/bareos/release/

没有评论

发表评论

Bareos
如何部署Bareos备份6-备份GlusterFS

6 备份GlusterFS的数据 6.1 基本配置 6.1.1 配置存储客户端名称 In Glust …

Bareos
如何部署Bareos备份5-备到GlusterFS

5 备份保存到GlusterFS 5.1 基本配置 5.1.1 配置名称解析 vim /etc/ho …

Bareos
如何部署Bareos备份4-添加客户端

4 添加备份客户端 4.1 基本配置 4.1.1 配置主机名称 In Clients hostnam …