Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

NDMP file level restoration using command line

Created: 26 Jan 2010 • Updated: 28 Jan 2010 | 1 comment
Language Translations
Sriram's picture
0 0 Votes
Login to vote

NDMP file level restoration using command line

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.

It actually saved us lot of time.

Comments 1 CommentJump to latest comment

Tulika Shrivastava's picture

Hi Sriram,

Just a query (Step no. 8)

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> /

In my environment this command is not displaying the desired output :-

Please see the output as below:- (1st :- Not working for root / )

nibackup@PNIOYNBMST01:~> bplist -C <hostname> -S <master> -k <Policyname> -R -t 19 -s 06/05/2012 -e 06/06/2012 /

EXIT STATUS 227: no entity was found

***Below command is working WORKING *** (for Share name specified )

 
nibackup@PNIOYNBMST01:~> bplist -C <hostname>10 -S <master> -k <Policyname> -R -t 19 -s  06/05/2012 -e 06/06/2012 /sunisdn
/sunisdn/
/sunisdn/data/
/sunisdn/data/.DS_Store
 
0
Login to vote