當前位置:首頁文章首頁 IT學院 IT技術(shù)

利用bacula完成數(shù)據(jù)的備份恢復(fù)

作者:  來源:  發(fā)布時間:2012-2-16 8:52:38  點擊:

 
2. 在客戶端啟動bacula的File Daemon
[root@baculaserver etc]#/usr/local/bacula/etc/bacula {start|stop|restart|status}
[root@baculaserver etc]#/usr/local/bacula/etc/bacula-fd {start|stop|restart|status} 
#由于baculaclient只做fd端,在此只需啟動bacula-fd服務(wù)即可
 
五、bacula備份文件
1. 創(chuàng)建卷組
[root@baculaserver etc]# ./bconsole
Connecting to Director 192.168.32.30:9101
1000 OK: 2012-02-15-dir Version: 5.0.1 (24 February 2010)
Enter a period to cancel a command.
*label           #創(chuàng)建一個卷組
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
Automatically selected Storage: dbsd
Enter new Volume name: webbak        #卷組名稱,可隨意指定,指定完畢后,會在bacula-dir.conf中Device邏輯字段指定的/home/webbak下生成一個文件
Automatically selected Pool: dbpool
Connecting to Storage daemon dbsd at 192.168.32.30:9103 ...
Sending label command for Volume "webbak" Slot 0 ...
3000 OK label. VolBytes=202 DVD=0 Volume="webbak" Device="dbdev" (/home/webbak)
Catalog record for Volume "webbak", Slot 0  successfully created.
Requesting to mount dbdev ...
3906 File device "dbdev" (/home/webbak) is always mounted.
You have messages.
#只有在使用磁帶卷時才需要這樣,而像我們剛才使用的磁盤卷,Bacula是可以自動進行l(wèi)abel的。想要刪除測試數(shù)據(jù)的話,就將/tmp目錄下的卷直接刪除,再使用drop_mysql_tables和make_mysql_tables腳本  
                                                                                                  
2. 執(zhí)行備份
2.1 第一次增量備份,默認會是一個完全備份  #備份前fd中文件有index1.html
*run
A job name must be specified.
The defined Job resources are:
     1: webjob
     2: Restoreweb
Select Job resource (1-2): 1        #選擇備份任務(wù)
Run Backup job
JobName:  webjob
Level:    Incremental
Client:   2012-02-15-fd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2012-02-15 23:29:58
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=1          
#到處為止,可以開始備份了,在bacula-dir.conf文件中定義的webjob是一個增量備份,因此這個備份只是一個增量操作,由于是第一個備份,因此默認webjob會做一個完全備份,第二次備份時才執(zhí)行增量備份
 
2.2 第二次增量備份,只做增量操作 #備份前fd中文件有index1.html、index2.html                                                                                                         
*run
A job name must be specified.
The defined Job resources are:
     1: webjob
     2: Restoreweb
Select Job resource (1-2): 1
Run Backup job
JobName:  webjob
Level:    Incremental
Client:   2012-02-15-fd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2012-02-15 23:37:00
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=2                                                                                                                              
#這是第二備份,只做一個增量操作
 
2.3 第三次備份,手動改為差異備份  #備份前fd中文件有index1.html、index2.html 、index3.html
*run
A job name must be specified.
The defined Job resources are:
     1: webjob
     2: Restoreweb
Select Job resource (1-2): 1
Run Backup job
JobName:  webjob
Level:    Incremental
Client:   2012-02-15-fd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2012-02-15 23:40:15
Priority: 10
OK to run? (yes/mod/no): mod         #mod修改備份任務(wù)參數(shù)
Parameters to modify:
     1: Level
     2: Storage
     3: Job
     4: FileSet
     5: Client
     6: When
     7: Priority
     8: Pool
     9: Plugin Options
Select parameter to modify (1-9): 1   #1表示選擇備份類別
Levels:
     1: Full
     2: Incremental
     3: Differential
     4: Since
     5: VirtualFull
Select level (1-5): 3                 #3表示差異備份
Run Backup job
JobName:  webjob
Level:    Differential
Client:   2012-02-15-fd
FileSet:  dbfs
Pool:     dbpool (From Job resource)
Storage:  dbsd (From Job resource)
When:     2012-02-15 23:40:15
Priority: 10
OK to run? (yes/mod/no): yes
Job queued. JobId=3
 
3. 查看備份狀態(tài)
*status
Status available for:
     1: Director
     2: Storage
     3: Client
     4: All
Select daemon type for status (1-4): 1
2012-02-15-dir Version: 5.0.1 (24 February 2010) i686-pc-linux-gnu redhat Enterprise release
Daemon started 15- 212 23:05, 3 Jobs run since started.
 Heap: heap=258,048 smbytes=65,799 max_bytes=113,185 bufs=204 max_bufs=231
 
Scheduled Jobs:
Level          Type     Pri  Scheduled          Name               Volume
===================================================================================
Differential   Backup    10  16- 212 07:00  webjob             *unknown*
====
 
Running Jobs:
Console connected at 15- 212 23:40
No Jobs running.
====
 
Terminated Jobs:
 JobId  Level    Files      Bytes   Status   Finished        Name
====================================================================
     1  Full          3         5   OK       15- 212 23:30 webjob
     2  Incr          2         5   OK       15- 212 23:37 webjob
     3  Diff          3         9   OK       15- 212 23:40 webjob
#顯示備份任務(wù)webjob第一次為full完全備份,第二次為增量備份,第三次為差異備份。
首頁 上一頁 [2] [3] [4] [5] [6]  下一頁 尾頁

相關(guān)文章

文章評論

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z