CentOS Stream 9
Sponsored Link

Bacula : リストアの操作2022/07/20

 
取得したバックアップデータからのリストアの操作方法です。
[1] Bacula コンソールからリストアを実行します。
[root@dlp ~]#
bconsole

Connecting to Director localhost:9101
1000 OK: 10002 bacula-dir Version: 11.0.1 (05 February 2020)
Enter a period to cancel a command.

# リストアタスクを開始
*restore
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"

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: bacula-fd
Automatically selected FileSet: Full Set
+-------+-------+----------+----------+---------------------+--------------+
| JobId | Level | JobFiles | JobBytes | StartTime           | VolumeName   |
+-------+-------+----------+----------+---------------------+--------------+
|     1 | F     |        5 |      446 | 2022-07-19 11:30:05 | Vol-20220719 |
+-------+-------+----------+----------+---------------------+--------------+
You have selected the following JobId: 1

Building directory tree for JobId(s) 1 ...
3 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: /

# バックアップデータを一覧表示
$ ls
home/
# リストアしたいデータをマーキング
$ mark home
6 files marked.
# マーキングしたデータを一覧表示
$ lsmark
*home/
  *cent/
    *.bash_logout
    *.bash_profile
    *.bashrc
# リストア設定を終了
$ done
Bootstrap records written to /var/spool/bacula/bacula-dir.restore.1.bsr

The Job will require the following (*=>InChanger):
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================

    Vol-20220719              File1                     FileChgr1

Volumes marked with "*" are in the Autochanger.


5 files selected to be restored.

Using Catalog "MyCatalog"
Run Restore job
JobName:         RestoreFiles
Bootstrap:       /var/spool/bacula/bacula-dir.restore.1.bsr
Where:           /tmp/bacula-restores
Replace:         Always
FileSet:         Full Set
Backup Client:   bacula-fd
Restore Client:  bacula-fd
Storage:         File1
When:            2022-07-19 12:52:27
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*

# リストアジョブ実行
OK to run? (yes/mod/no): yes
Job queued. JobId=2

# メッセージ (ログ) を表示
*messages
19-Jul 12:53 bacula-dir JobId 2: Start Restore Job RestoreFiles.2022-07-19_12.53.44_05
19-Jul 12:53 bacula-dir JobId 2: Restoring files from JobId(s) 1
19-Jul 12:53 bacula-dir JobId 2: Using Device "FileChgr1-Dev2" to read.
19-Jul 12:53 bacula-sd JobId 2: Ready to read from volume "Vol-20220719" on File device "FileChgr1-Dev2" (/tmp).
19-Jul 12:53 bacula-sd JobId 2: Forward spacing Volume "Vol-20220719" to addr=228
19-Jul 12:53 bacula-sd JobId 2: End of Volume "Vol-20220719" at addr=1673 on device "FileChgr1-Dev2" (/tmp).
19-Jul 12:53 bacula-sd JobId 2: Elapsed time=00:00:01, Transfer rate=913  Bytes/second
19-Jul 12:53 bacula-dir JobId 2: Bacula bacula-dir 11.0.1 (05Feb20):
  Build OS:               x86_64-redhat-linux-gnu redhat
  JobId:                  2
  Job:                    RestoreFiles.2022-07-19_12.53.44_05
  Restore Client:         bacula-fd
  Where:                  /tmp/bacula-restores
  Replace:                Always
  Start time:             19-Jul-2022 12:53:46
  End time:               19-Jul-2022 12:53:46
  Elapsed time:           1 sec
  Files Expected:         5
  Files Restored:         5
  Bytes Restored:         651 (651 B)
  Rate:                   0.7 KB/s
  FD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Restore OK

19-Jul 12:53 bacula-dir JobId 2: Begin pruning Jobs older than 6 months .
19-Jul 12:53 bacula-dir JobId 2: No Jobs found to prune.
19-Jul 12:53 bacula-dir JobId 2: Begin pruning Files.
19-Jul 12:53 bacula-dir JobId 2: No Files found to prune.
19-Jul 12:53 bacula-dir JobId 2: End auto prune.

*exit

[root@dlp ~]#
ll /tmp/bacula-restores/home

total 0
drwx------. 2 cent cent 62 Nov 26  2021 cent
# リストアされた
関連コンテンツ