承接模組化的備份機制 - bacula一文
CLI Backup
1. 建立備份用Job
vi /etc/bacula/bacula-dir.conf
Job {
Name = "testbackup"
Type = Backup
Level = Incremental
Client = bacula-fd
FileSet = "testfile"
Schedule = "WeeklyCycle"
Storage = File
Messages = Standard
Pool = Default
}
2. 定義要備份的來源路徑
vi /etc/bacula/bacula-dir.conf
FileSet {
Name = "testfile"
Include {
Options {
signature = MD5
}
File = /etc
}
}
/etc/init.d/bacula-dir restart
3. 使用CLI執行備份
bconsole
3-1 建立備份使用的Volume
*label
3-2 輸入自訂名稱
Enter new Volume name:testVolum
3-3 選擇供哪一Pool使用
Defined Pools:
1: Default
2: File
3: Scratch
Select the Pool (1-3): 1
3-4 執行備份指令
*run
3-5 選擇執行哪一個Job
The defined Job resources are:
1: testbackup
2: BackupClient1
3: BackupCatalog
4: RestoreFiles
Select Job resource (1-4): 1
3-6 執行成功畫面
CLI Restore
1. 建立還原Job(Optional)
vi /etc/bacula/bacula-dir.conf (建議只要一個Restore Job即可)
Job {
Name = "testrestore"
Type = Restore
Client = bacula-fd
FileSet = "testfile"
Storage = File
Pool = Default
Messages = Standard
Where = /tmp/bacula-restores
}
/etc/init.d/bacula-dir restart
2. 使用CLI執行還原
bconsole
*restore
2-1 選擇使用何種方式執行還原
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): 11
2-2 輸入某一時間點備份成功的Job Id
Enter JobId(s), comma separated, to restore: 1
2-3 輸入欲還原檔案在備份路徑下的絕對位置
可輸入多組路徑,如欲結束直接按Enter即可
Enter directory name: /etc
Enter directory name:
2-3 選擇使用哪一個Restore Job
The defined Restore Job resources are:
1: testrestore
2: RestoreFiles
Select Restore Job (1-2): 1
2-4 還原成功的畫面
參考文章:
http://ssorc.tw/rewrite.php/read-169.html
沒有留言:
張貼留言