• bacula 备份恢复


    一、数据恢复:
    在bacula服务器执行:
    /opt/bacula/etc/ bconsole   #进入交互窗口
    *restore   #输入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    #选择5  
    Defined Clients:
         1: 192-168-9-71
         2: 192.168.9.70-fd
         3: 192.168.9.71-fd
         4: 971
         5: DianTaiShenBan
         6: GongWenJiaoHuan
         7: GongZuoGuanLi
         8: HaiYangJianCe
         9: NeiWangMenHu
        10: ShengJuMenHuJiu
        11: ShengJuMenHuXin
        12: ShuJuKu
        13: ZhiBiaoBaoSong
        14: anquanjuizhu98
        15: anquanjuizhu98data
        16: bacula-server-fd
        17: client-192.168.9.71
        18: localhost.localdomain-fd
    Select the Client (1-18): 6   #选择客户端公文交换系统
    The defined FileSet resources are:
         1: gwjh-tomcat_xchg
         2: test
    Select FileSet resource (1-2): 2  #选择要还原的数据
    +-------+-------+----------+---------------+---------------------+------------+
    | JobId | Level | JobFiles | JobBytes      | StartTime           | VolumeName |
    +-------+-------+----------+---------------+---------------------+------------+
    |   160 | F     |        2 | 1,373,306,880 | 2017-05-19 02:14:18 | test       |
    +-------+-------+----------+---------------+---------------------+------------+
    You have selected the following JobId: 160
    
    Building directory tree for JobId(s) 160 ...  
    1 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: /
    $ mark *    #还原所有
    2 files marked.
    $ done
    Bootstrap records written to /opt/bacula/working/bacula-server-dir.restore.1.bsr
    Bootstrap records written to /opt/bacula/working/bacula-server-dir.restore.1.bsr
    
    The Job will require the following (*=>InChanger):
       Volume(s)                 Storage(s)                SD Device(s)
    ===========================================================================
       
        test                      File1                     FileChgr1                
    
    Volumes marked with "*" are in the Autochanger.
    2 files selected to be restored.
    Using Catalog "MyCatalog"
    Run Restore job
    JobName:         RestoreFiles
    Bootstrap:       /opt/bacula/working/bacula-server-dir.restore.1.bsr
    Where:           /tmp/bacula-restores
    Replace:         Always
    FileSet:         Full Set
    Backup Client:   GongWenJiaoHuan
    Restore Client:  GongWenJiaoHuan
    Storage:         File1
    When:            2017-05-23 15:07:45
    Catalog:         MyCatalog
    Priority:        10
    Plugin Options:  
    OK to run? (yes/mod/no): mod   #输入mod,选择还原到那里
    Parameters to modify:
         1: Level
         2: Storage
         3: Job
         4: FileSet
         5: Restore Client
         6: When
         7: Priority
         8: Bootstrap
         9: Where
        10: File Relocation
        11: Replace
        12: JobId
        13: Plugin Options
    Select parameter to modify (1-13): 9  
    Please enter the full path prefix for restore (/ for none): /  #选择还原到原来的位置
    Run Restore job
    JobName:         RestoreFiles
    Bootstrap:       /opt/bacula/working/bacula-server-dir.restore.1.bsr
    Where:           
    Replace:         Always
    FileSet:         Full Set
    Backup Client:   GongWenJiaoHuan
    Restore Client:  GongWenJiaoHuan
    Storage:         File1
    When:            2017-05-23 15:07:45
    Catalog:         MyCatalog
    Priority:        10
    Plugin Options:  
    OK to run? (yes/mod/no): yes  #执行操作
    Job queued. JobId=199
    二、数据验证:
    去还原的目录查看有无还原的数据:
    
    进行MD5验证:
    恢复之前的MD5值:
    恢复后的MD5值:
    两个一样则表明数据一样。
  • 相关阅读:
    linux常用命令的英文单词缩写
    Servlet Struts2 SpringMVC 获取参数与导出数据 方法比较
    Spring 整合Mybatis Mapper动态代理方法
    Spring 整合Mybatis dao原始方法
    Mybatis Mapper动态代理方式 typeAliases 别名的使用
    MySQL 高性能优化实战总结
    Chrome 浏览器最牛插件之一 Vimium
    Spring Cloud-微服务架构集大成者
    单点登录原理与简单实现
    Spring-WebSocket 教程
  • 原文地址:https://www.cnblogs.com/chimeiwangliang/p/7168642.html
Copyright © 2020-2023  润新知