Bacula : Run Restore2020/02/17 |
This is basic Restore Operation fron backup data.
|
|
[1] | Run Restore on Bacula console. |
[root@dlp ~]# bconsole Connecting to Director localhost:9101 1000 OK: 103 bacula-dir Version: 9.0.6 (20 November 2017) Enter a period to cancel a command. # start restore task *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. # select restore job # select latest backup job (#5) on this example 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 Client: bacula-fd Automatically selected FileSet: Full Set +-------+-------+----------+----------+---------------------+--------------+ | JobId | Level | JobFiles | JobBytes | StartTime | VolumeName | +-------+-------+----------+----------+---------------------+--------------+ | 1 | F | 6 | 394 | 2020-02-12 19:35:56 | Vol-20200213 | +-------+-------+----------+----------+---------------------+--------------+ You have selected the following JobId: 1 Building directory tree for JobId(s) 1 ... 4 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: / # show backup data $ ls home/ # mark data you'd like to restore $ mark home 6 files marked. # show marked file list $ lsmark *home/ *cent/ *.bash_logout *.bash_profile *.bashrc *testfile.txt # finish restore setting $ done Bootstrap records written to /var/spool/bacula/bacula-dir.restore.3.bsr The Job will require the following (*=>InChanger): Volume(s) Storage(s) SD Device(s) =========================================================================== Vol-20200213 File1 FileChgr1 Volumes marked with "*" are in the Autochanger. 6 files selected to be restored. Using Catalog "MyCatalog" Run Restore job JobName: RestoreFiles Bootstrap: /var/spool/bacula/bacula-dir.restore.3.bsr Where: /tmp/bacula-restores Replace: Always FileSet: Full Set Backup Client: bacula-fd Restore Client: bacula-fd Storage: File1 When: 2020-02-12 19:47:30 Catalog: MyCatalog Priority: 10 Plugin Options: *None* # run restore job OK to run? (yes/mod/no): yes Job queued. JobId=4 # show messages (log) *messages 12-Feb 19:47 bacula-dir JobId 4: Start Restore Job RestoreFiles.2020-02-12_19.47.32_13 12-Feb 19:47 bacula-dir JobId 4: Using Device "FileChgr1-Dev2" to read. 12-Feb 19:47 bacula-sd JobId 4: Ready to read from volume "Vol-20200213" on File device "FileChgr1-Dev2" (/tmp). 12-Feb 19:47 bacula-sd JobId 4: Forward spacing Volume "Vol-20200213" to addr=227 12-Feb 19:47 bacula-sd JobId 4: End of Volume "Vol-20200213" at addr=1747 on device "FileChgr1-Dev2" (/tmp). 12-Feb 19:47 bacula-sd JobId 4: Elapsed time=00:00:01, Transfer rate=952 Bytes/second 12-Feb 19:47 bacula-dir JobId 4: Bacula bacula-dir 9.0.6 (20Nov17): Build OS: x86_64-redhat-linux-gnu redhat (Core) JobId: 4 Job: RestoreFiles.2020-02-12_19.47.32_13 Restore Client: bacula-fd Start time: 12-Feb-2020 19:47:34 End time: 12-Feb-2020 19:47:35 Files Expected: 6 Files Restored: 6 Bytes Restored: 490 Rate: 0.5 KB/s FD Errors: 0 FD termination status: OK SD termination status: OK Termination: Restore OK 12-Feb 19:47 bacula-dir JobId 4: Begin pruning Jobs older than 6 months . 12-Feb 19:47 bacula-dir JobId 4: No Jobs found to prune. 12-Feb 19:47 bacula-dir JobId 4: Begin pruning Files. 12-Feb 19:47 bacula-dir JobId 4: No Files found to prune. 12-Feb 19:47 bacula-dir JobId 4: End auto prune. *exit[root@dlp ~]# ll /tmp/bacula-restores/home
total 4
drwx------. 2 cent cent 62 Oct 12 22:39 cent
-rw-r--r--. 1 root root 19 Feb 12 19:28 testfile.txt
# backup data restored
|
[2] | If SELinux is enabled, change policy because restore job fails. |
[root@dlp ~]#
vi baculafd.te # create new module baculafd 1.0; require { type bacula_t; type bacula_tmp_t; class lnk_file { create setattr }; class capability dac_override; } #============= bacula_t ============== allow bacula_t bacula_tmp_t:lnk_file { create setattr }; allow bacula_t self:capability dac_override; checkmodule -m -M -o baculafd.mod baculafd.te checkmodule: loading policy configuration from baculafd.te checkmodule: policy configuration loaded checkmodule: writing binary representation (version 19) to baculafd.mod [root@dlp ~]# semodule_package --outfile baculafd.pp --module baculafd.mod [root@dlp ~]# semodule -i baculafd.pp |
Sponsored Link |