Zusammenfassung

Hier wird beschrieben, wie selbst ein Restore vorgenommen werden kann.


Diese Anleitung richtet sich besonders an folgende Zielgruppen: -Nicht zutreffende Zielgruppen bitte löschen-

  • Mitarbeitende

Bconsole

Es gibt eine Konsolenschnittstelle zum Bareos Server. Für einzelne User kann eine zugeschnittene Sicht auf einige Server/Backups erzeugt werden, damit dort auch individuelle Restores selbst möglich sind.

Voraussetzung

Anwendung

  1. SSH Login mit eigener Kennung an 'bcons.rz.uni-jena.de'.
  2. Befehl 'bconsole' eingeben.

Nun gibt es dort verschiedene Befehle, die auch mit 'help' abgefragt werden können.

Allgemein

Liste der Befehle, bzw. Hilfe

* help
* help status

Status des Backup Servers

* status dir

Status eines Clients (auch check ob erreichbar)

* status client=floh.rz.uni-jena.de


Liste der Jobs und Backups eines Clients (ggf. mit Beschränkung der letzten Tage)

* list jobs client=floh.rz.uni-jena.de
* list backups client=floh.rz.uni-jena.de
* list backups client=floh.rz.uni-jena.de days=4

Testen, wie viel ein aktuelles Backup benötigen würde:

* estimate job=floh.rz

Anschauen der Konfigurationene in Bareos:

* show client=floh.rz.uni-jena.de
* show job=floh.rz
* show jobs
* show jobdefs=ServerDefaultJob3W
* show fileset=default-win-fs1
* show schedule=3WS

Restore


* restore
* restore client=floh.rz.uni-jena.de

Für die nächste Frage sind vermutlich meist nur die Punkte 2, 5 und 6 relevant.

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

Nun erfolgt nochmal eine Kontrolle. Normalerweise wird nach /tmp/bareos-restore zurückgesichert. Wenn dies bestätigt wird, startet der Restore. Mit status dir

Beispiel 1


* restore client=floh.rz.uni-jena.de

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): 2
Enter Filename (no path):blabla.txt
+-------+-----------------------+---------------------+---------+-----------+----------+----------------+
| jobid | name                  | starttime           | jobtype | jobstatus | jobfiles | jobbytes       |
+-------+-----------------------+---------------------+---------+-----------+----------+----------------+
| 9419  | /home/floh/blabla.txt | 2016-01-31 12:00:06 | B       | W         | 723222   | 25847959779    |
| 8095  | /home/floh/blabla.txt | 2016-01-14 09:02:21 | B       | W         | 720177   | 26887045352    |
| 7187  | /home/floh/blabla.txt | 2016-01-07 16:02:12 | B       | T         | 1952     | 206679936      |
+-------+-----------------------+---------------------+---------+-----------+----------+----------------+
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): 3
Enter JobId(s), comma separated, to restore: 8095
You have selected the following JobId: 8095

Building directory tree for JobId(s) 8095 ...  +++++++++++++++++++++++++++++++++++++++++++++
658,342 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
etc/
home/
root/
$ mark /home/floh/blabla.txt
1 file marked.
$ done
Bootstrap records written to /var/lib/bareos/bareos1-dir.restore.13.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================
   
    VFBP-21149                VirtualStorageVFB         VirtualVFB               

Volumes marked with "*" are online.


1 file selected to be restored.

Automatically selected Job: RestoreDummy
Run Restore job
JobName:         RestoreDummy
Bootstrap:       /var/lib/bareos/bareos1-dir.restore.13.bsr
Where:           /tmp/bareos-restores
Replace:         Always
FileSet:         default-linux-fs0
Backup Client:   floh.rz.uni-jena.de
Restore Client:  floh.rz.uni-jena.de
Format:          Native
Storage:         VirtualStorageVFB
When:            2016-02-11 15:28:11
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no): yes
Job queued. JobId=10670


Wenn der Restorepfad /tmp/bareos-restores nicht passt, insbesondere für WIndows muss dieser angepasst weden z.B.: 'D:/bareos-restores/'



*status dir
*list joblog jobid=10670

Beispiel 2


*restore client=bcons.rz.uni-jena.de

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 FileSet: default-linux-fs1
+--------+-------+----------+-------------+---------------------+------------+
| jobid  | level | jobfiles | jobbytes    | starttime           | volumename |
+--------+-------+----------+-------------+---------------------+------------+
|  9,973 | F     |   10,129 | 473,003,772 | 2016-02-05 19:10:02 | OF0516L6   |
| 10,102 | I     |       11 |     168,082 | 2016-02-08 21:25:53 | OF0516L6   |
| 10,456 | I     |        3 |     130,522 | 2016-02-09 19:02:52 | OF0516L6   |
| 10,586 | I     |       10 |     143,905 | 2016-02-10 19:03:30 | OF0516L6   |
+--------+-------+----------+-------------+---------------------+------------+
You have selected the following JobIds: 9973,10102,10456,10586

Building directory tree for JobId(s) 9973,10102,10456,10586 ...  ++++++++++++++++++++++++++++++++++++++++
8,287 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
etc/
home/
root/
usr/
$ cd home
cwd is: /home/
$ ls
de65lun/
lost+found
$ mark de65lun
11 files marked.
$ done
Bootstrap records written to /var/lib/bareos/bareos1-dir.restore.14.bsr

The job will require the following
   Volume(s)                 Storage(s)                SD Device(s)
===========================================================================
   
   *OF0516L6                  Scalar6k-TWR              Scalar6k-TWR             

Volumes marked with "*" are online.


12 files selected to be restored.

Automatically selected Job: RestoreDummy
Run Restore job
JobName:         RestoreDummy
Bootstrap:       /var/lib/bareos/bareos1-dir.restore.14.bsr
Where:           /tmp/bareos-restores
Replace:         Always
FileSet:         default-linux-fs0
Backup Client:   bcons.rz.uni-jena.de
Restore Client:  bcons.rz.uni-jena.de
Format:          Native
Storage:         Scalar6k-TWR
When:            2016-02-11 15:35:30
Catalog:         MyCatalog
Priority:        10
Plugin Options:  *None*
OK to run? (yes/mod/no): yes
Job queued. JobId=10671
*status dir days=0
...
 JobId Level   Name                       Status
======================================================================
 10671         RestoreDummy.2016-02-11_15.35.33_25 is running
====
...
*list joblog jobid=10671
 2016-02-11 15:35:35 bareos1-dir JobId 10671: Start Restore Job RestoreDummy.2016-02-11_15.35.33_25
 2016-02-11 15:35:35 bareos1-dir JobId 10671: Using Device "LTO6-twr-05" to read.
*

WebUI

Der Restore über eine Weboberfläche wird auch möglich sein, wird aber noch etwas dauern bis diese hier zur Verfügung steht.

...

Verwandte Artikel

Verwandte Artikel erscheinen hier basierend auf den Stichwörtern, die Sie auswählen. Klicken Sie, um das Makro zu bearbeiten und Stichwörter hinzuzufügen oder zu ändern.



Verwandte Vorgänge



Titel: "Restore mit Bareos"

Stand: 29.01.2020