CentOS 7
Ads

Bacula : Restore Operation
2015/07/21
 
This is basic Restore Operation.
It's possible to opereate on both Server and Client. (this example is on Client)
[1] Run Restore.
[root@node01 ~]#
bconsole

Connecting to Director dlp.srv.world:9101
1000 OK: bacula-dir Version: 5.2.13 (19 February 2013)
Enter a period to cancel a command.
*
restore
   
# input 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
   
# select 5 as an example (most recent backup)

Automatically selected Client: bacula-fd
Automatically selected FileSet: Full Set
+-------+-------+----------+----------+---------------------+--------------+
| JobId | Level | JobFiles | JobBytes | StartTime           | VolumeName   |
+-------+-------+----------+----------+---------------------+--------------+
|     1 | F     |        5 |      369 | 2015-07-21 23:48:23 | Vol-20150721 |
+-------+-------+----------+----------+---------------------+--------------+
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
# display backuped file list

home/
$
mark home
# mark target file to restore

5 files marked.
$
lsmark
# confirm marked file

*home/
  *cent/
    *.bash_logout
    *.bash_profile
    *.bashrc
$
done
# run restore

Bootstrap records written to /var/spool/bacula/bacula-dir.restore.1.bsr

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

    Vol-20150721              File                      FileStorage

Volumes marked with "*" are online.


5 files selected to be restored.

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:         File
When:            2015-07-22 15:08:02
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no):
yes

Job queued. JobId=2
*
messages
   
# show messages

22-Jul 15:09 bacula-dir JobId 2: Start Restore Job RestoreFiles.2015-07-22_00.09.16_06
22-Jul 15:09 bacula-dir JobId 2: Using Device "FileStorage" to read.
22-Jul 15:09 bacula-sd JobId 2: Ready to read from volume "Vol-20150721" on device "FileStorage" (/tmp).
22-Jul 15:09 bacula-sd JobId 2: Forward spacing Volume "Vol-20150721" to file:block 0:207.
22-Jul 15:09 bacula-sd JobId 2: End of Volume at file 0 on device "FileStorage" (/tmp), Volume "Vol-20150721"
22-Jul 15:09 bacula-sd JobId 2: End of all volumes.
22-Jul 15:09 bacula-dir JobId 2: Bacula bacula-dir 5.2.13 (19Jan13):
  Build OS:               x86_64-redhat-linux-gnu unknown unknown
  JobId:                  2
  Job:                    RestoreFiles.2015-07-22_00.09.16_06
  Restore Client:         bacula-fd
  Start time:             22-Jul-2015 00:09:19
  End time:               22-Jul-2015 00:09:19
  Files Expected:         5
  Files Restored:         5
  Bytes Restored:         442
  Rate:                   0.0 KB/s
  FD Errors:              0
  FD termination status:  OK
  SD termination status:  OK
  Termination:            Restore OK

22-Jul 00:09 bacula-dir JobId 2: Begin pruning Jobs older than 6 months .
22-Jul 00:09 bacula-dir JobId 2: No Jobs found to prune.
22-Jul 00:09 bacula-dir JobId 2: Begin pruning Files.
22-Jul 00:09 bacula-dir JobId 2: No Files found to prune.
22-Jul 00:09 bacula-dir JobId 2: End auto prune.

*
exit
   
# quit
[root@node01 ~]#
ls -laR /tmp/bacula-restores

/tmp/bacula-restores:
total 4
drwxr-xr-x  3 root root   17 Jul 22 15:09 .
drwxrwxrwt. 9 root root 4096 Jul 22 15:09 ..
drwxr-xr-x  3 root root   17 Jul  9  2014 home

/tmp/bacula-restores/home:
total 0
drwxr-xr-x 3 root root 17 Jul  9  2014 .
drwxr-xr-x 3 root root 17 Jul 22 15:09 ..
drwx------ 2 cent cent 59 Jul  9  2014 cent

/tmp/bacula-restores/home/cent:
total 12
drwx------ 2 cent cent  59 Jul  9  2014 .
drwxr-xr-x 3 root root  17 Jul  9  2014 ..
-rw-r--r-- 1 cent cent  18 Jun 10  2014 .bash_logout
-rw-r--r-- 1 cent cent 193 Jun 10  2014 .bash_profile
-rw-r--r-- 1 cent cent 231 Jun 10  2014 .bashrc
# just restored

 
Tweet