Veritas-bu

[Veritas-bu] script request

2004-05-20 14:16:36
Subject: [Veritas-bu] script request
From: tech2187 AT yahoo DOT com (K Chapman)
Date: Thu, 20 May 2004 11:16:36 -0700 (PDT)
--0-695864599-1085076996=:42537
Content-Type: text/plain; charset=us-ascii

you are going to backup to disk local and than duplicate over the wan or am i 
not reading this correctly...  or duplicate local as well?
 
you dont mention your ver...  5 has disk for staging built in (though this may 
not be what you want..  earlier version could use the vault add on or you can 
do what youre looking for which is script it.
 
everyone has diff req's for doing this, so here is what i use for doing mass 
disk to tape dups, from one of our disk stu's and clear out the space if the 
dup works...  sort -u can replace sort|uniq, as well as some other things that 
could be updated/replaced...  i have my own scripts for doing stats which is 
what the $prep var is..  the formating is bad for cut and paste.
 
STUNIT="<target storage unit>"
NBPOOL="<target pool>"
ADM="/opt/openv/netbackup/bin/admincmd"
prep=/tmp/copyprep
disktgt="<disk image location>"
rm -f $prep
for client in `ls $disktgt|grep -v "lost"|sed -e "s/_.*_C.*F.*$/_/"|sort|uniq`
do
        backupid=`ls $disktgt|grep "$client"|sed 's/_C1.*//'|sort|uniq`
        for image in $backupid
        do
  # make sure the image isnt invalid/expired etc...
                out=`$ADM/bpimagelist -l -backupid $image 2>/dev/null`
                err=`echo $?`
                if [ "$err" = "0" ]; then
                        outdup=`$ADM/bpduplicate -dstunit $STUNIT -dp $NBPOOL 
-backupid $image -set_primary 1 -L /tmp/dup_$image`
                        # check for valid duplication
                        errdup=`echo $?`
                        # delete old image if duplication succeeds
                        if [ "$errdup" = "0" ]; then
                                echo "done"
                                $ADM/bpexpdate -backupid $image -d 0 -copy 1 
-force
    # dump some stats to a file
                                $ADM/bperror |grep "wrote backup id $image"|awk 
'{print $6,$15}'|sed -e "s/,//"|sort|uniq >> $prep
                        else
                                mailx -s "dup failed" <some one who cares> < 
/tmp/dup_$image
                        fi
                fi
        done
done

"Loyless, Maureen" <LoylessM AT pcaobus DOT org> wrote:
Hi all,
 
Does anyone have a bpduplicate script that they use to duplicate a disk image 
to tape, make it primary and then expire the disk image?  Or, alternatively, a 
location online that might have one?  I know backupscripts.com has shutdown...
 
I'd be very interested in a script that does this.  We are trying to change our 
backups to disk rather than tapes in each of our WAN locations, and then 
centralize the tapes.  I've seen a few threads that talk about this and then 
suggest a script for bpduplicate...
 
TIA!
Maureen
 

___________________________________________

Maureen Loyless

Systems Engineer

Public Company Accounting Oversight Board

www.pcaobus.org

 

202.207.9267 (Office)

202.368.9673 (Mobile)

loylessm AT pcaobus DOT org 

 

 


aaarrrggghhh!!!!
FreeBSD rocks
                
---------------------------------
Do you Yahoo!?
Yahoo! Domains - Claim yours for only $14.70/year
--0-695864599-1085076996=:42537
Content-Type: text/html; charset=us-ascii

<DIV>you are going to backup to disk local and than duplicate over the wan or 
am i not reading this correctly...&nbsp; or duplicate local as well?</DIV>
<DIV>&nbsp;</DIV>
<DIV>you dont mention your ver...&nbsp; 5 has disk for staging built in (though 
this may not be what you want..&nbsp; earlier version could use the vault add 
on or you can do what youre looking for which is script it.</DIV>
<DIV>&nbsp;</DIV>
<DIV>everyone has diff req's for doing this, so here is what i use for doing 
mass disk to tape dups, from one of our disk stu's and clear out the space if 
the dup works...&nbsp; sort -u can replace sort|uniq, as well as some other 
things that could be updated/replaced...&nbsp; i have my own scripts for doing 
stats which is what the $prep var is..&nbsp; the formating is bad for cut and 
paste.</DIV>
<DIV>&nbsp;</DIV>
<DIV>STUNIT="&lt;target storage unit&gt;"<BR>NBPOOL="&lt;target 
pool&gt;"<BR>ADM="/opt/openv/netbackup/bin/admincmd"<BR>prep=/tmp/copyprep<BR>disktgt="&lt;disk
 image location&gt;"</DIV>
<DIV>rm -f $prep</DIV>
<DIV>for client in `ls $disktgt|grep -v "lost"|sed -e 
"s/_.*_C.*F.*$/_/"|sort|uniq`<BR>do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 backupid=`ls $disktgt|grep "$client"|sed 
's/_C1.*//'|sort|uniq`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for image 
in $backupid<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do<BR>&nbsp;&nbsp;# 
make sure the image isnt invalid/expired 
etc...<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 out=`$ADM/bpimagelist -l -backupid $image 
2&gt;/dev/null`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 err=`echo 
$?`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 if [ "$err" = "0" ]; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 outdup=`$ADM/bpduplicate -dstunit $STUNIT -dp $NBPOOL -backupid $image 
-set_primary 1 -L
 
/tmp/dup_$image`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 # check for valid 
duplication<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 errdup=`echo 
$?`<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 # delete old image if duplication 
succeeds<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 if [ "$errdup" = "0" ]; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 echo
 
"done"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 $ADM/bpexpdate -backupid $image -d 0 -copy 1 
-force<BR>&nbsp;&nbsp;&nbsp;&nbsp;# dump some stats to a 
file<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 $ADM/bperror |grep "wrote backup id $image"|awk '{print $6,$15}'|sed -e 
"s/,//"|sort|uniq &gt;&gt; 
$prep<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
else<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 mailx -s "dup failed" &lt;some one who cares&gt; &lt;
 
/tmp/dup_$image<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 
fi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 fi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
done<BR>done<BR><BR><B><I>"Loyless, Maureen" &lt;LoylessM AT pcaobus DOT 
org&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; 
BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<DIV><SPAN class=427544115-20052004><FONT face=Arial size=2>Hi 
all,</FONT></SPAN></DIV>
<DIV><SPAN class=427544115-20052004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=427544115-20052004><FONT face=Arial size=2>Does anyone have a 
bpduplicate script that they use to duplicate a disk image to tape, make it 
primary and then expire the disk image?&nbsp; Or, alternatively, a location 
online that might have one?&nbsp; I know backupscripts.com has 
shutdown...</FONT></SPAN></DIV>
<DIV><SPAN class=427544115-20052004><FONT face=Arial 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=427544115-20052004><FONT face=Arial size=2>I'd be very 
interested in a script that does this.&nbsp; We are trying to change our 
backups to disk rather than tapes in each of our WAN locations, and then 
centralize the tapes.&nbsp; I've seen a few threads that talk about this and 
then suggest a script for bpduplicate...</FONT></SPAN></DIV>
<DIV><SPAN class=427544115-20052004></SPAN><SPAN class=427544115-20052004><FONT 
face=Arial size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=427544115-20052004><FONT face=Arial 
size=2>TIA!</FONT></SPAN></DIV>
<DIV><SPAN class=427544115-20052004><FONT face=Arial 
size=2>Maureen</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV align=left>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><FONT 
face=Arial>___________________________________________</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left><SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"><FONT face=Arial>Maureen 
Loyless</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial>Systems Engineer</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial color=#800000><STRONG>Public Company 
Accounting Oversight Board</STRONG></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><A href="http://www.pcaobus.org/";><SPAN 
style="FONT-FAMILY: Arial">www.pcaobus.org</SPAN></A></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial></FONT></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial>202.207.9267 (Office)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial>202.368.9673 (Mobile)</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial><A href="mailto:loylessm AT pcaobus DOT 
org">loylessm AT pcaobus DOT org</A>&nbsp;</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; 
FONT-FAMILY: Tahoma"><FONT face=Arial></FONT></SPAN>&nbsp;</P></DIV>
<DIV>&nbsp;</DIV></BLOCKQUOTE><BR><BR>aaarrrggghhh!!!!<br>FreeBSD rocks<p>
                <hr size=1><font face=arial size=-1>Do you Yahoo!?<br>Yahoo! 
Domains - <a 
href="http://us.rd.yahoo.com/evt=23613/*http://smallbusiness.promotions.yahoo.com/offer";>Claim
 yours for only $14.70/year</a>
--0-695864599-1085076996=:42537--

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