1. It was after the chirstmas and newyear holiday's, when users found their data was missing. We dont know how the data went missing nor the user.
2. There were more than 10 users who lost their data, which was spread accross multiple parent/sub directories, and thousand's of files were involved. really a critical situation.
3. We had an emergency request put in place,in which it had thousands of files spread across multiple folders
4. Using Netbackup JAVA GUI or admin console required manual effort to select all those files and folders which is going to take days to finish
5. So we thought why not try Netbackup command line to restore it and started to work on gathering the data and constructing the commands
6. When constructing the command, we had a small challenge ahead of us to construct the main part of restore command
7. First had to list all files and folders. Second we had to format it to fit the command syntax
8. To list all files we used bplist command as follows:
“bplist –C <ndmp host> -S <master server> -k <policy> -R -t <backup type> -s <backup start date> -e <backup end date> /”
9. Command in step 8 displayed all the files corresponding to the NDMP host, policy and the backup dates entered.
10. We filtered the output from step 9 to get the files and folders that was needed for the restore and save it in a separate file. Here we got to do a small scripting to grep all the files required from the output.
11. After getting the required files formatted that output to fit the core restore command syntax.
12. The format should be something like this: <character count in a line including spaces> <file name you filtered in step 10>
Eg: 34 c:\program files\netbackup\bp.conf
13. Step 12 was repeated for all the files generated in step 10 and saved in another file.
14. Formatting the required output in step 12 was little bit tricky because it involved thousands of files. Again i had to work on a script to do this.
15. Once finished the formatting it was time to fit it in the main restore command
16. Here is the main restore command : bprestore -C <source client> -D <target client> -S <master server> -t <restore type> -p <policy> -H -y -l -f <file name formatted in step 11>
17. This command reads the file mentioned in option “-f” and will restore the list of files inside it.