现在去看看备份路径下面是否生成了备份文件
# du -sh *
9.7M woyun
可以看到这个卷有9.4M的大小了,原来是4K的文件,再次证明了备份成功了.
下面做还原的操作,我们把client端的被备份目录下面文件进行删除
[root@localhost bacula]# rm -rf *
[root@localhost bacula]# ls
然后我们到directory端进行还原
# ./bconsole
Connecting to Director 10.10.2.226:9101
1000 OK: linux-0fdr-dir Version: 2.4.3 (10 October 2008)
Enter a period to cancel a command.
*restore
Automatically selected Catalog: dbcatalog
Using Catalog "dbcatalog"
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: Cancel
Select item: (1-12): 5
Automatically selected Client: dbfd
Automatically selected FileSet: dbfs
+-------+-------+----------+-----------+---------------------+------------+
| JobId | Level | JobFiles | JobBytes | StartTime | VolumeName |
+-------+-------+----------+-----------+---------------------+------------+
| 54 | F | 1,628 | 9,773,751 | 2009-08-25 15:23:18 | woyun |
+-------+-------+----------+-----------+---------------------+------------+
You have selected the following JobId: 54
Building directory tree for JobId 54 ... +++++++++++++++++++++++++++++++++++++++++++++++++
1 Job, 1,621 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 home
1,628 files marked.
$ done
Bootstrap records written to /var/bacula/working/linux-0fdr-dir.restore.1.bsr
The job will require the following
Volume(s) Storage(s) SD Device(s)
===========================================================================
woyun dbsd dbdev
1,628 files selected to be restored.
Run Restore job
JobName: restrory
Bootstrap: /var/bacula/working/linux-0fdr-dir.restore.1.bsr
Where: /home/bacula/
Replace: always
FileSet: dbfs
Backup Client: dbfd
Restore Client: dbfd
Storage: dbsd
When: 2009-08-25 16:09:03
Catalog: dbcatalog
Priority: 10
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
Select parameter to modify (1-12): 9
Please enter path prefix for restore (/ for none): /home/bacula
Run Restore job
JobName: restrory
Bootstrap: /var/bacula/working/linux-0fdr-dir.restore.1.bsr
Where: /home/bacula
Replace: always
FileSet: dbfs
Backup Client: dbfd
Restore Client: dbfd
Storage: dbsd
When: 2009-08-25 16:09:03
Catalog: dbcatalog
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=55
*exit
OK还原完成,我们现在到client端看看有什么还原回来
[root@localhost bacula]# ls
bacula-2.4.3 bacula-2.4.3.tar.gz
看到了已经还原回来了,说明我们的还原操作已经实现了.
本文转自wiliiwin 51CTO博客,原文链接:http://blog.51cto.com/wiliiwin/199297