Monday 12 March 2012

[ CentOS 5 - Bacula ] Restore from Backup ( Part 6 )

Restore from Backup

Run restore from backup on client. It is possible to execute restore not only on server but on client.


Step [1] Run restore
[root@dlp4 ~]#
bconsole

Connecting to Director 192.168.0.20:9101
1000 OK: dlp-dir Version: 3.0.1 (30 April 2009)
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: Cancel
Select item: (1-12):
1
# make sure job number

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):
3
# select job ID

Enter JobId(s), comma separated, to restore:
1
 
# specify job ID for restore


Building directory tree for JobId(s) 32 ...
4 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
# display backup files

home/ $
mark home
# mark files you'd like to restore

6 files marked.
$
lsmark
# display restore files

*home/
*cent/
*.bash_logout
*.bash_profile
*.bashrc
*test
$
done
# done to choose

Bootstrap records written to /var/lib/bacula/dlp-dir.restore.1.bsr
6 files selected to be restored.

Run Restore job
JobName:
RestoreFiles

Bootstrap:
/var/lib/bacula/dlp-dir.restore.1.bsr

Where:
/var/restores

Replace:
always

FileSet:
Full Set

Backup Client:
dlp-fd

Restore Client:
dlp-fd

Storage:
File

When:
2009-05-10 11:04:57

Catalog:
MyCatalog

Priority:
10

Plugin Options:
*None*

OK to run? (yes/mod/no):
yes
# run restore

Job queued. JobId=2
*
exit

[root@dlp4 ~]#
ll /var/restores

total 4
drwxr-xr-x 3 root root 4096 May 10 05:25 home
# completed to restore