Veritas-bu

Re: [Veritas-bu] Help - Script to Change primary image

2010-02-06 01:36:16
Subject: Re: [Veritas-bu] Help - Script to Change primary image
From: "smpt" <smpt1 AT peppas DOT gr>
To: <VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU>
Date: Sat, 6 Feb 2010 08:36:30 +0200
Well, the best way to restore from another copy, is to put a file with the
copy number in it, at the netbackup directory. Call the file
ALT_RESTORE_COPY_NUMBER and you are OK. No need of scripts.  

Check
http://support.veritas.com/docs/312838

If this is not sufficient for you, I made a script for a customer having
backups with 2 and 3 copies and want to restore from the biggest. It is in
bash (for windows), but you can change it if you are running windows or
unix.

echo "...Creating Image List..."
cat_path=/dev/fs/C/snapscripts
rm -f $cat_path/image_catalog.txt
mediaid=`vmquery.exe -rn 9 -l |awk '{print $1}'`
for i in $mediaid
do
      bpimmedia.exe -mediaid $i  -l |grep IMAGE |awk '{print
$4}'>>$cat_path/image_catalog.txt
done
cat $cat_path/image_catalog.txt |sort|uniq >$cat_path/image_catalog1.txt
echo "..Starting to Change primary copy number"
for i in `cat $cat_path/image_catalog1.txt`
do
        echo change primary copy to copy 2 for $i
        bpchangeprimary.exe -copy 2 -id $i >nul 2>nul
        echo change primary copy to copy 3 for $i
        bpchangeprimary.exe -copy 3 -id $i >nul 2>nul
done    

Stefanos

-----Original Message-----
From: veritas-bu-bounces AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-bounces AT mailman.eng.auburn DOT edu] On Behalf Of diegoa_a
Sent: Friday, February 05, 2010 5:38 PM
To: VERITAS-BU AT MAILMAN.ENG.AUBURN DOT EDU
Subject: [Veritas-bu] Help - Script to Change primary image


Hello all,

I4m trying to make a script capeble to change the primary copy of a backup
in DRP case. I have two copies in distincts librarys and I need to promove
the second copy to primary. Detail: My invirnment is MS-Win. I4m running the
bpimmedia command to select all images of the on tape, as: bpimmedia.exe
-mediaid "id".

When I ran this command, it returns a lot of unnecessary information. Do you
think this is the best command to take the image name?

After have the image name, i am thinking use the bpchangeprimary.

Cheers,

Diego

+----------------------------------------------------------------------
|This was sent by diegoa_a AT yahoo.com DOT br via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------



_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu

<Prev in Thread] Current Thread [Next in Thread>