cancel
Showing results for 
Search instead for 
Did you mean: 

bprestore command

NIKHIL234656595
Level 6

 

Hi ALL,

 

Still I am unable to restore .Please can anybody  provide the example of a restore by bprestore.

and the output of each file using cat command.

1 ACCEPTED SOLUTION

Accepted Solutions

mph999
Level 6
Employee Accredited

Sorry, I'm confusing things

'rename' will not work, this was only a variable in the script.

ok. 

This

 

-bash-3.2$ cat filelist
/u27/oradata/MKBP/trace_files/afiedt.buf
 
Looks fine.
 
But this ...
 
-bash-3.2$ cat alt_locate
change /u27/oradata/MKBP/trace_files/ to /tmp/restore/
 
... look at my example, I do not have the last /
 
So, change this file to this
 
change /u27/oradata/MKBP/trace_files to /tmp/restore
 
(Again, make sure there is a carriadge return, so the cusror is on the 2md line)
 
Then try again.
 
Martin
 
 
 

 

View solution in original post

21 REPLIES 21

revarooo
Level 6
Employee

define "unable to restore" 

Are you getting errors?

Do you not know what commands to run?

mph999
Level 6
Employee Accredited

We have given an exact solution to this already, including the exact 'details' to put in the files.

Marianne suggested using the bplist command to confirm the files are available to restore.  Have you done this ?  For all we know, we could be trying to restore a file that is not available.

How about using the GUI to do the restore. ?  This will prove the files can be restored.

 

Martin

NIKHIL234656595
Level 6

I have did that many times.Trust me but i guess soething is going wrong.Files comes in bplist command but not able to restore through bprestore command.Please can anybody restore and provide me the details of each steps.

mph999
Level 6
Employee Accredited

Here is the Unix version ...  Windows should be the same.

 

#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/alt_locate
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
root@womble scripts $
 
 
There are two commands, depending on if you are relocating which you are so the command is :
 
bprestore -s $STARTDATE -S $MASTER -C $SOURCE -D $DESTINATION -L $LOGFILE  -R $RENAMEFILE -f $FILELIST
 
 
The top bit explains the files,a nd what to put in them.
 
This is actually a unix script - it works 100% correctly.  Note, I only used -s <start date> you can use -e <end date> as well.  You will alos need to use -t <type of policy>, mentioned in the other post.
 
Martin
 

Patrick_Whelan_
Level 6

I missed the other post. What are you restoring from and to. Is a windows box from a  unix server. Are you on the server itself, or are you pushing it from the master? Is it a database or exchange? Or just a flat file?

I appologize if these questions were answered in the other post.

USAGE: bprestore [-A | -B] [-K] [-l | -H | -y] [-r] [-T]
      [-L progress_log [-en]] [-R rename_file] [-C client]
      [-D client] [-S master_server] [-disk_media_server media_server]
      [-t policy_type] [-p policy] [-k "keyword phrase"] [-cm] [-drs]
      [-md] [-dd] [-td temp_dir] [-F file_options] [-copy copy_number]
      [-s mm/dd/yyyy  [HH:MM:SS]] [-e mm/dd/yyyy  [HH:MM:SS]]
      [-w [hh:mm:ss]] -f listfile | filenames
      [-BR sharepoint_redirected_portal | sharepoint_redirected_teamsite]
      [-spsredir_server sharepoint_redirected_hostname]
      [-granular_restore] [-priority number]
      [-spsverkeep <0|1|2>] [-spscurver] [-spsignorelock] [-spspreserveiis] [-spsrestoresecurity]
 

 

NIKHIL234656595
Level 6

@Martin:

Can u provide cat output of below files:

/tmp/res/alt_locat

tmp/res/restore_log.txt

/tmp/res/filelist

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

Please show us your bplist command, and the output of the command.

Then show us your bprestore command (including contents of any text files used in bprestore command).

We can only help if show us us exactly what the issue is.

bprestore works - you just need to have ALL the options correct. One mistake will cause status 227.

mph999
Level 6
Employee Accredited

 

/tmp/res/alt_locate

change /netbackup/testdata to /tmp/res<CR>   (<CR> means carridge return)

/tmp/res/filelist

/netbackup/testdata/file1.txt

 

Restore log is created when you run the command.

NIKHIL234656595
Level 6

I want cat file name of all above text files

watsons
Level 6

You need to really get down to what requirement you have, how you tested, show us the exact command you used, what the error you got - only then I guess we can start somewhere. I do believe those who replied had given you plenty of clues to run a test. 

bprestore can do lots of restore command, and not only typical "MS-Windows" and "Standard" backup type. So there are too many options to explain. Need to be as specific as possible.

mph999
Level 6
Employee Accredited

Call the file anything you link, providing you put the correct things in the file it is fine.

If you create the files with the names I showed, you put these file names in the command.

Martin

mph999
Level 6
Employee Accredited

Eg.

 

bprestore -s $STARTDATE -S $MASTER -C $SOURCE -D $DESTINATION -L /tmp/log.txt  -R /tmp/res/alt_locate -f /tmp/res/filelist

Where the two files contain

/tmp/res/alt_locate

change /netbackup/testdata to /tmp/res<CR>   (<CR> means carridge return)

/tmp/res/filelist

/netbackup/testdata/file1.txt

Martin

NIKHIL234656595
Level 6

 

-bash-3.2$ sudo ./bprestore -s  08/25/2012  -C ux234  -D ux234 -L /tmp/res/log.txt  -R /tmp/res/alt_locate -f /tmp/res/filelist
Error in rename line: </u27/oradata/MKBP/trace_files/ to /tmp/restore/> at or near keyword <change >
EXIT STATUS 144: invalid command usage
 
-bash-3.2$ cd /usr/openv/netbackup/bin
-bash-3.2$ sudo ./bprestore -s  08/25/2012 -S lxmaster   -C ux234  -D ux234  L /tmp/res/log.txt  -R /tmp/res/alt_locate -f /tmp/res/filelist
Error in rename line: </u27/oradata/MKBP/trace_files/ to /tmp/restore/> at or near keyword <change >
EXIT STATUS 144: invalid command usage
 
-bash-3.2$ pwd
/usr/openv/netbackup/bin
 
 
 
-bash-3.2$ cd /tmp/res
-bash-3.2$ ls -ltr
total 8
-rwxrwxrwx 1 root root  0 Aug 26 01:36 restore_log.txt
-rw-r----- 1 root root  0 Aug 26 02:05 log.txt
-rwxrwxrwx 1 root root 41 Aug 26 02:09 filelist
-rwxrwxrwx 1 root root 49 Aug 26 02:09 alt_locate
-bash-3.2$ cat restore_log.txt
-bash-3.2$ cat filelist
/u27/oradata/MKBP/trace_files/afiedt.buf
-bash-3.2$ cat alt_locate
/u27/oradata/MKBP/trace_files/ to /tmp/restore/
 
-bash-3.2$
 
 
-bash-3.2$ sudo ./bplist -C ux234 -R 1 -b -l  -s  08/18/2012  /u27/oradata/MKBP/trace_files/afiedt.buf
 
-rw-r--r-- oracle    dba                80 Aug 25 11:30 /u27/oradata/MKBP/trace_files/afiedt.buf
-rw-r--r-- oracle    dba                80 Aug 18 11:30 /u27/oradata/MKBP/trace_files/afiedt.buf
 
ux234 is the client
lxmaster is the master server

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified

You forgot the word rename or change in your alt_locate file:

/u27/oradata/MKBP/trace_files/ to /tmp/restore/ 

should be:

change /u27/oradata/MKBP/trace_files/ to /tmp/restore/ 

The error is actually telling you what is wrong:

Error in rename line: </u27/oradata/MKBP/trace_files/ to /tmp/restore/> at or near keyword <change >

 

Please see this TN on how to create 'rename file' and the usage of 'rename' and 'change' in this file: 

http://www.symantec.com/docs/HOWTO43687
 

 

NIKHIL234656595
Level 6

 

-bash-3.2$ sudo ./bprestore -s  08/25/2012 -S lxmaster  -C ux234 -D ux234 -L /tmp/log.txt  -R /tmp/alt_locate -f /tmp/filelist
Invalid line length in line:
EXIT STATUS 144: invalid command usage
 
 
-bash-3.2$ sudo cat log.txt
Restore started 08/26/2012 04:27:09
 
04:27:11 Status of restore from copy 1 of image created Sat 25 Aug 2012 11:30:13 AM EDT = client process aborted
 
04:27:11 The following files/folders were not restored:
04:27:11 UTF - /u27/oradata/MKBP/trace_files/afiedt.buf
 
04:27:11 (951366.xxx) INF - Status = client process aborted.
 
========================
 
-bash-3.2$ cat restore_log.txt
-bash-3.2$ cat filelist
/u27/oradata/MKBP/trace_files/afiedt.buf
 
-bash-3.2$ cat alt_locate
change /u27/oradata/MKBP/trace_files/ to /tmp/restore/
 

 

mph999
Level 6
Employee Accredited

At the end of this line 

change /u27/oradata/MKBP/trace_files/ to /tmp/restore/ 

You must press the return key, so that the cursor is on the 2nd line in the file

Martin

NIKHIL234656595
Level 6

i have done that

Marianne
Moderator
Moderator
Partner    VIP    Accredited Certified
Suggestion 1: Try 'rename' instead of 'change' as per Martin's example. Suggestion 2: Carefully read through examples for rename and change in the TN that I have posted above. Apply examples to your environment. Keep on trying until you find the correct rename syntax that works for you. We cannot spoon-feed you every step of the way. Otherwise me might as well do your job for you.

mph999
Level 6
Employee Accredited

Sorry, I'm confusing things

'rename' will not work, this was only a variable in the script.

ok. 

This

 

-bash-3.2$ cat filelist
/u27/oradata/MKBP/trace_files/afiedt.buf
 
Looks fine.
 
But this ...
 
-bash-3.2$ cat alt_locate
change /u27/oradata/MKBP/trace_files/ to /tmp/restore/
 
... look at my example, I do not have the last /
 
So, change this file to this
 
change /u27/oradata/MKBP/trace_files to /tmp/restore
 
(Again, make sure there is a carriadge return, so the cusror is on the 2md line)
 
Then try again.
 
Martin