Bextract
Bextract
1. Get list of volumes from TechDB
To get an idea of what files you'll need, you need to examine the TechDB Backups tab. For each backup, a line will be printed which starts "Volume name(s):" - this should be in the following format:
srv-7813711322-3889
srv-7813711322-3882
srv-7813711322-3875
srv-7813711322-3868
srv-7813711322-3861
srv-7813711322-3854
srv-7813711322-3847
srv-7813711322-3891
2. Create bootstrap file
This is a text file containing a list of volumes for Bacula to read from, in the correct order, it's format should be as follows (oldes to newest):
Volume=srv-78_137_113_22-3847
Volume=srv-78_137_113_22-3854
Volume=srv-78_137_113_22-3861
Volume=srv-78_137_113_22-3868
Volume=srv-78_137_113_22-3875
Volume=srv-78_137_113_22-3882
Volume=srv-78_137_113_22-3889
Volume=srv-78_137_113_22-3891
There's a little cheat to make this step easier which is the below command that should be run from within the backups directory on backups server (typically /home/bacula/clientIP_IP_IP_IP):
ls -latr srv* | awk '{print $9}' | sed 's/\(.*\)/Volume=\1/' > bootstrap.bsr
3. Create includes file
The next thing to create is a file whichthat describes which files you want to extract from the backups, this is just another text file, containing the paths to the files you want to restore, separated by linebreaks, e.g:
/path/to/required/files
/path2/to/required/files
NotNote: This file is not needed if you need to restore everything.everything within a backup file.
4. Create the output directory (on backup server)
Create a directory for the extract command to output the backup contents to. This needs to be on the backup server as we'll look to transfer the files to the client later on.
5. Running the command
TheThere firstare 2 sets of these commands willhere, justdiffering **list**for PyBaculaV2 and none-pybac backup server. (Most we deal with now have been upgraded to PyBacV2).
The only real difference between the files2 inoptions is the backupstorage volumestype youthat's specified,specified. theFor secondPyBacV2, will **extract** the files into the folder you gave. Only files that match the includes.txt file will be extracted.
If you are running this command on a PyBaculav2 server you willyou'll need to replacespecify the device prefix, whereas for none-pybac, you'll need to specify the storage prefix with device instead
List the files in the backup volumes:prefix.
pybaculav2:PyBaculaV2:
View files included in backup (with includes.txt taken into account):
bls -b bootstrap.bsr -i includes.txt -pv device-78_137_113_22IP_IP_IP_IP
Initiate bextract:
bextract -b bootstrap.bsr -i includes.txt -pv storage-IP_IP_IP_IP /path/to/restore/to
None-PyBac
View files included in backup (with includes.txt taken into account):
bls -b bootstrap.bsr -i includes.txt -pv storage-IP_IP_IP_IP
Initiate bextract:
bextract -b bootstrap.bsr -i includes.txt -pv storage-IP_IP_IP_IP /path/to/output/
6. Transfer files to client-server
Feel free to use your preferred file transfer method for this step, for the below I've detailed how to achieve this using rysnc.
A. Compress the file before transfer
tar -czf zipfilename.tar.gz filetoarchive
B. Transfer the files
rsync -r -e "ssh -p2020" /path/to/files/on/backup/server 'root@[client:server:BAC:address]':/client/server/restore/path
C. Uncompress files on client-server
(extracts into current working directory)
tar -xzf archivename.tar.gz