Video Screencast Help

bprestore

Created: 26 Jun 2013 • Updated: 01 Jul 2013 | 21 comments
This issue has been solved. See solution.
 ]$ sudo ./bprestore -R /tmp/rename -C duster1  -D duster1  -s 06/25/2013 00:00:00 -e 06/27/2013 23:00:00 -f  /tmp/filelist
 
[]$ cat /tmp/rename
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90  to /tmp/restore.txt
 
 
 
[]$ cat /tmp/filelist
/usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list
 
I ran the above command and the restore in GUI completed with status 0.
 
But I am unable to find the file on the destination path.
 
[]$ cat /tmp/restore.txt
Operating Systems:

Comments 21 CommentsJump to latest comment

noazara's picture
cat /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list
1371812410 1372071610
 
 
Above file is also in the bplist command
mph999's picture

No access to a server at the min, so can't test.
First thing to check, make sure the line in the /tmp/rename file has a carriage return at the end (press Enter)

Martin

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture

It has a carriage return

 cat /tmp/rename
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90  to /tmp/restore.txt
 
[ bin]$
 
CRZ's picture

Is /tmp/restore.txt a directory?  It doesn't look like a directory, but I'm just playing hunches here.

Read this (again) - it's an oldie but goodie but the example syntax is still valid:

How to use the bprestore command to redirect a restore to an alternate path on the client
 http://symantec.com/docs/TECH34216

Want something more recent?  Here's the almost always reliable Commands Guide!  You have once again failed to tell us what NetBackup version, so I have picked the 7.0 Guide at random:

Symantec NetBackup (tm) 7.0 Commands
 http://symantec.com/docs/TECH127047 (see page 318)

While I'm playing hunches, and anticipating your next three replies, you probably want to try any or all of these educated guesses at what might fix your situation:

1. Change your rename file to specify a complete filename path in BOTH places instead of just one - like /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list instead of /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/ - you can get away with this so long as you're only restoring one file;

2. Change your rename file to specify a directory path in BOTH places instead of just one - like changing your restore path to /tmp and see if that works (and if you're REALLY keen on getting that restored file renamed, manually mv preview.list restore.txt yourself after your restore completes);

3. Go ahead and a directory named restore.txt under /tmp and your rename file will now have directory paths in both places, so your rename file may then work

...but I would never try to guess what you're thinking, so please take all these suggestions with the appropriate skepticism...maybe come up with one of your own!

But, yes, definitely read that Commands Guide entry for bprestore (again).


bit.ly/76LBN | APPLBN | 761LBN

mph999's picture

Try this script.

#!/usr/bin/ksh
 
#Script to restore files via filelist, written M. Holt, Netbackup Support, Symantec 2010
# **  WARNING - please check this script, run only if you are happy that it will not cause any adverse effect to your system
#Useage - restore.sh <filelist> <startdate>
 
#Filelist - list of files to restore
#Startdate - earliest date of backedup files
#Renamefile - File containg altpath eg.  change /netbackup/testdata to /tmp/res<CR>  (<CR> - Carriage return)
 
#Define variables
 
RENAMEFILE=/tmp/res/mph
LOGFILE=/tmp/res/restore_log.txt
FILELIST=/tmp/res/filelist
MASTER=womble  #master server
SOURCE=womble  #source machine for original backup
DESTINATION=womble  #destination/ target machine for restored files
STARTDATE=$1 #Startdate of earlist files to restore format mm/dd/yyyy
 
#Uncomment the line below if there is a restore file (restoring to an alt location)
bprestore -s $STARTDATE -S $MASTER -C $SOURCE -D $DESTINATION -L $LOGFILE  -R $RENAMEFILE -f $FILELIST
 
#Uncomment the line below if you are restoring to the same location
#bprestore -s $STARTDATE -S $MASTER -C $SOURCE -D $DESTINATION -L $LOGFILE  -f $FILELIST
 
Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture

@CRZ:I have created this file /tmp/restore.txt.

What all I am lagging?

This should be a directory?

mph999's picture

This line is wrong

change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90  to /tmp/restore.txt

The /tmp/restore.txt should be the name of the alternative directory

Look at my example :

change /netbackup/testdata to /tmp/res<CR>

/netbackup/testdata is the name if the source dir, /tmp/res is the alternate location.  

Martin

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture
cat /tmp/rename
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list  to /tmp
 
@root2 tmp]$
 
tmp]$ cat /tmp/filelist
/usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list
 
 
still unable to find the restored file and restore is completing with status 0.
 
Where are the files going?
 
mph999's picture

For what I can see it should go to /tmp
Can you try the script ?

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
mph999's picture

Does it work if you don't do an alternate restore ?

I'll try it tomrrow on a server and se if I can see what is wrong.

The script works (well did last time I used it) so I'm a bit confused. Can you do an alternate restore using the GUI ? We should really make sure it can work, and then worry about the command.

Martin

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture

It is working with the GUI.

mph999's picture

Here you are :

Original file location for file1 was /netbackup/testdata on master server womble

Restoreed this to alt location /netbackup/tmp
 
$ cat filelist
/netbackup/testdata/file1
 
$ cat altres
change /netbackup/testdata to /netbackup/tmp    (there is a <CR> at the end of this line)
 
Ran this command:
 
bprestore -s 06/28/2013 -S womble -C womble -D womble -L /netbackup/tmp/log.txt  -R /netbackup/tmp/altres -f /netbackup/tmp/filelist
 
file1 was restored to alternate path (/netbackup/tmp) successfully.
 
Hope this helps, 
 
Martin
Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture

Thanks.

were u able to  find the file under /netbackup/tmp

cat  /netbackup/tmp/file1     .

Is this giving u the output?

mph999's picture

Yes, the file was successfully restored to the alternative location, /netbackup/tmp

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture

I dont know why I am not seeing it on destination.Neways thans Martin fir all ur help and replies..

CRZ's picture

Amazing - I gave you the answer days ago but you (and Martin?!) still haven't figured this out.

Here's what you originally had:

cat /tmp/rename
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90  to /tmp/restore.txt
Way up there, I told you - and I thought I was pretty explicit in describing it, but I see now that I have failed - I told you that you CAN'T use the syntax of "change <directory_path> to <file_path>" in your rename file and you would have to change it.  I even gave you two choices - you could have changed it to "change <directory_path> to <directory_path>" OR "change <file_path> to <file_path>" - but instead, you somehow decided to go in ANOTHER direction and...
cat /tmp/rename
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list  to /tmp
...change BOTH paths, so now you have "change <file_path> to <directory_path>", which ALSO will not work!
 
Here are some capital letters.
 
FIX YOUR RENAME FILE TO SOMETHING THAT WILL WORK IF YOU WANT IT TO WORK.  CHANGE *ONE* PATH TO MATCH THE OTHER.  DO NOT CHANGE BOTH PATHS.
 
Because you can only understand when someone actually spells it out for you rather than follow a simple instruction, I will go against all my better judgment and actually spell it out for you rather than just use generalities:
 
Your rename file should be changed to one (AND ONLY ONE) of these two choices:
 
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90/preview.list to /tmp/restore.txt
 
OR
 
change /usr/openv/netbackup/vault/sessions/Eject_Monday/sid90 to /tmp
 
Please tell me you understand this now.  There is absolutely no way I can be any more clear than this and I may have to just quit my job if you still don't get it after this reply.
 
If you had read any of the links I provided, you should have been able to figure this out, like, four days ago.  Really, it's hard for me to express how disappointed I am.


bit.ly/76LBN | APPLBN | 761LBN

SOLUTION
noazara's picture

But CRZ sir,Martin is saying something else.

noazara's picture

Thanks CRZ.It worked.Now I am able to see the file.The time stamp in the destination is showing 20th july 2011.

mph999's picture

Now I'm confused ...

Are you saying that using my method, it still didn't work ?

If so,  I currently have no idea why, I ran the exact commands on my machine, it worked, I then copied /pasted to this post, to be sure i didn't make any mistakes.

If it is the case that Chris' post worked for you, you should give him the solution.

M

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
noazara's picture

Done.

Really heartly thanks to chris sir and Martin Sir !!!