開啟bconsole輸入restore指令以後會看到這樣:
Automatically selected Catalog: MyCatalogUsing Catalog "MyCatalog"
First you select one or more JobIds that contain filesto be restored. You will be presented several methodsof specifying the JobIds. Then you will be allowed toselect which files from those JobIds are to be restored.To select the JobIds, you have the following choices:1: List last 20 Jobs run2: List Jobs where a given File is saved3: Enter list of comma separated JobIds to select4: Enter SQL list command5: Select the most recent backup for a client6: Select backup for a client before a specified time7: Enter a list of files to restore8: Enter a list of files to restore before a specified time9: Find the JobIds of the most recent backup for a client10: Find the JobIds for a backup for a client before a specified time11: Enter a list of directories to restore for found JobIds12: Select full restore to a specified Job date13: CancelSelect item: (1-13):
比較常用的幾個選項就是
1:列出最後20個Job
3:輸入JobIds 從這個JobId做還原
5:選一個client(FD),從最新的備份來還原
選1會看到Job的清單,記得你要還原的JobId
選3 輸入剛剛記下來的JobId
再來要使用mark指令,把你要還原的東西選出來
Enter JobId(s), comma separated, to restore: 65You have selected the following JobId: 65
Building directory tree for JobId(s) 65 ...2 files inserted into the tree.
You are now entering file selection mode where you add (mark) andremove (unmark) files to be restored. No files are initially added, unlessyou used the "all" keyword on the command line.Enter "done" to leave this mode.
cwd is: /$
也可以用ls 和cd 指令看有哪些東西可以選,或是進到特定的目錄中
像這樣
cwd is: /$ lse:/$ cd e:/cwd is: e:/$ lsabc/$ mark abc4 files marked.$ ls*abc/$ done
被mark的目錄 ,前面會出現" * "
如果mark到不想選的東西,可以用unmark來取消
選好以後輸入done畫面變成下面這樣
Bootstrap records written to /var/lib/bacula/yucing-dir.restore.4.bsr
The job will require the followingVolume(s) Storage(s) SD Device(s)================================================================Vol0001 File FileStorage
Volumes marked with "*" are online.
4 files selected to be restored.
The defined Restore Job resources are:1: RestoreFiles2: RestoreFiles51Select Restore Job (1-2): 1Defined Clients:1: yucing-fd2: yucing-pc-fdSelect the Client (1-2): 2
選擇用來還原的 Job 和 Clients (FD)
這邊是選 看你在bacula-dir.conf中設定的 Job哪個比較符合現在還原動作的需求
不過詳細的內容還是可以再後面修改
Run Restore jobJobName: RestoreFilesBootstrap: /var/lib/bacula/yucing-dir.restore.4.bsrWhere: /bacula/backup/bacula2/Replace: alwaysFileSet: TESTBackup Client: yucing-pc-fdRestore Client: yucing-pc-fdStorage: FileWhen: 2011-07-24 16:09:19Catalog: MyCatalogPriority: 10Plugin Options: *None*OK to run? (yes/mod/no):
再來會跟你說現在要做的還原工作的詳細內容
要取消輸入no
要調整設定輸入mod
確定無誤可以還原了就輸入yes
因為上面的where沒有設定到一開始備份來的地方,所以要還原到一開始備份的地方要選mod
OK to run? (yes/mod/no): modParameters to modify:1: Level2: Storage3: Job4: FileSet5: Restore Client6: When7: Priority8: Bootstrap9: Where10: File Relocation11: Replace12: JobId13: Plugin OptionsSelect parameter to modify (1-13): 9Please enter path prefix for restore (/ for none): /
選9 把where改成 / 就會把檔案還原到原來的地方
不然他會還原到他預設的路徑去
Run Restore jobJobName: RestoreFilesBootstrap: /var/lib/bacula/yucing-dir.restore.4.bsrWhere:Replace: alwaysFileSet: TESTBackup Client: yucing-pc-fdRestore Client: yucing-pc-fdStorage: FileWhen: 2011-07-24 16:09:19Catalog: MyCatalogPriority: 10Plugin Options: *None*OK to run? (yes/mod/no): yesJob queued. JobId=78You have messages.
設定好以後就輸入yes 還原工作就完成了
(如果還原比較多或比較大的檔案要稍等一下才會有messages)

沒有留言:
張貼留言