Veritas-bu

[Veritas-bu] Summary: relating files and images to tapes

2002-04-19 13:15:12
Subject: [Veritas-bu] Summary: relating files and images to tapes
From: Mark.Donaldson AT experianems DOT com (Donaldson, Mark)
Date: Fri, 19 Apr 2002 11:15:12 -0600
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1E7C5.C3D515E0
Content-Type: text/plain

To get the tapes for a given image, you can still use the bpimmedia report

Here's a quick-and-dirty script to do it.  It takes forever because it
searches the entire image database but it works.  You might also put
additional logic to add bpimmedia limiters (-d, -e, -class, -class, etc.)
and then add them to the bpimmedia line in the script.  to get
tape-for-file, you'll have to search the .../db/images... directories,
recover the image name (from where you searched), then feed that image name
to this script.

-Mark

$ cat ./tape_for_image
#!/bin/ksh
export PATH=$PATH:/usr/openv/netbackup/bin/admincmd
if [ -z "$1" ]
then
  echo "Usage: `basename $0` image_name ..."
else
  for bpid in $*
  do
    echo "Searching tapes for $bpid"
    bpimmedia | \
      awk '{if ( $1=="IMAGE" ) {if ( $4=="'$bpid'" ) {flag=1} else {flag=0}
}
            else { if ( flag==1 ) { print $9 } } }'  | sort -u
  done
fi

-----Original Message-----
From: Adam Levin [mailto:alevin AT audible DOT com]
Sent: Friday, April 19, 2002 9:29 AM
To: Veritas BU
Subject: [Veritas-bu] Summary: relating files and images to tapes



Ok, a couple of weeks ago, I asked about relating files to tapes.  We had
an issue where we wanted to know which tapes would be required for
backups.

Thanks to all who responded.

1) A few people mentioned the Java GUI which has a preview function.  I'd
prefer a command line version, but this could be made to work.
2) It's already possible to use bpimmedia to get images on a given tape.
We want to go the other way -- get tapes for a given image.
3) This doesn't solve the problem of getting the tapes for a given *file*.

Now, I spoke to someone at Veritas, and she said that the filelists for
backup images are kept in /usr/openv/netbackup/db/images/<client>.  This
is cool -- they are in text format, so I can have a script grep through
them to find the file, and then I have the backupID, and then I can find
the tapes for that backupID, and I should be done.

However, does anybody know what the fields are in that file.  Under the
<client> subdir, there are more subdirs with hashed backupIDs.  Under
there, there are files, one header file, and one filelist (the filelist
has a .f extension).  The filelist looks like this:

0 0 1 51 0 0 0 0 8388608 / 16877 root other 0 1008868013 1007744410
1007744410
0 0 9 50 1 0 0 0 46399504 /disk751/ 16877 root root 0 1008879253 1007658552
1007658552
0 0 15 51 2 0 0 0 46399504 /disk751/atest/ 16893 atest 9990 0 1008879253
1008879235 1008879235
0 0 19 51 3 0 0 0 46399504 /disk751/atest/OUT/ 16893 atest 9990 0 1008879253
1008879223 1008879223
1 0 38 50 4 1 0 0 46399504 /disk751/atest/OUT/bk_bant_000392_44k/ 16893
atest 9990 0 1008879228 992343637 1008879228
2 0 65 56 5 1 0 0 46399504
/disk751/atest/OUT/bk_bant_000392_44k/bk_bant_000392_rev1_pi2.wav 33277
atest 9990 1949818 1008861520 992343602 1008879228
...

I can figure out the filename, user and group, and I think the field
after group ID is the file size.

I'll be emailing Veritas as well, and I'll let you know what they say.

-Adam

Adam Levin, Senior Unix Systems Administrator | http://www.audible.com/
Audible, Inc.
Wayne, NJ, 07470                               In purple, I'm stunning.
973-837-2797                     

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

------_=_NextPart_001_01C1E7C5.C3D515E0
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3DUS-ASCII">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2653.12">
<TITLE>RE: [Veritas-bu] Summary: relating files and images to =
tapes</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>To get the tapes for a given image, you can still use =
the bpimmedia report</FONT>
</P>

<P><FONT SIZE=3D2>Here's a quick-and-dirty script to do it.&nbsp; It =
takes forever because it searches the entire image database but it =
works.&nbsp; You might also put additional logic to add bpimmedia =
limiters (-d, -e, -class, -class, etc.) and then add them to the =
bpimmedia line in the script.&nbsp; to get tape-for-file, you'll have =
to search the .../db/images... directories, recover the image name =
(from where you searched), then feed that image name to this =
script.</FONT></P>

<P><FONT SIZE=3D2>-Mark</FONT>
</P>

<P><FONT SIZE=3D2>$ cat ./tape_for_image</FONT>
<BR><FONT SIZE=3D2>#!/bin/ksh</FONT>
<BR><FONT SIZE=3D2>export =
PATH=3D$PATH:/usr/openv/netbackup/bin/admincmd</FONT>
<BR><FONT SIZE=3D2>if [ -z &quot;$1&quot; ]</FONT>
<BR><FONT SIZE=3D2>then</FONT>
<BR><FONT SIZE=3D2>&nbsp; echo &quot;Usage: `basename $0` image_name =
...&quot;</FONT>
<BR><FONT SIZE=3D2>else</FONT>
<BR><FONT SIZE=3D2>&nbsp; for bpid in $*</FONT>
<BR><FONT SIZE=3D2>&nbsp; do</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; echo &quot;Searching tapes for =
$bpid&quot;</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp; bpimmedia | \</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; awk '{if ( =
$1=3D=3D&quot;IMAGE&quot; ) {if ( $4=3D=3D&quot;'$bpid'&quot; ) =
{flag=3D1} else {flag=3D0} }</FONT>
<BR><FONT =
SIZE=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp; else { if ( flag=3D=3D1 ) { print $9 } } }'&nbsp; | sort -u</FONT>
<BR><FONT SIZE=3D2>&nbsp; done</FONT>
<BR><FONT SIZE=3D2>fi</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Adam Levin [<A =
HREF=3D"mailto:alevin AT audible DOT com">mailto:alevin AT audible DOT 
com</A>]</FONT>=

<BR><FONT SIZE=3D2>Sent: Friday, April 19, 2002 9:29 AM</FONT>
<BR><FONT SIZE=3D2>To: Veritas BU</FONT>
<BR><FONT SIZE=3D2>Subject: [Veritas-bu] Summary: relating files and =
images to tapes</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>Ok, a couple of weeks ago, I asked about relating =
files to tapes.&nbsp; We had</FONT>
<BR><FONT SIZE=3D2>an issue where we wanted to know which tapes would =
be required for</FONT>
<BR><FONT SIZE=3D2>backups.</FONT>
</P>

<P><FONT SIZE=3D2>Thanks to all who responded.</FONT>
</P>

<P><FONT SIZE=3D2>1) A few people mentioned the Java GUI which has a =
preview function.&nbsp; I'd</FONT>
<BR><FONT SIZE=3D2>prefer a command line version, but this could be =
made to work.</FONT>
<BR><FONT SIZE=3D2>2) It's already possible to use bpimmedia to get =
images on a given tape.</FONT>
<BR><FONT SIZE=3D2>We want to go the other way -- get tapes for a given =
image.</FONT>
<BR><FONT SIZE=3D2>3) This doesn't solve the problem of getting the =
tapes for a given *file*.</FONT>
</P>

<P><FONT SIZE=3D2>Now, I spoke to someone at Veritas, and she said that =
the filelists for</FONT>
<BR><FONT SIZE=3D2>backup images are kept in =
/usr/openv/netbackup/db/images/&lt;client&gt;.&nbsp; This</FONT>
<BR><FONT SIZE=3D2>is cool -- they are in text format, so I can have a =
script grep through</FONT>
<BR><FONT SIZE=3D2>them to find the file, and then I have the backupID, =
and then I can find</FONT>
<BR><FONT SIZE=3D2>the tapes for that backupID, and I should be =
done.</FONT>
</P>

<P><FONT SIZE=3D2>However, does anybody know what the fields are in =
that file.&nbsp; Under the</FONT>
<BR><FONT SIZE=3D2>&lt;client&gt; subdir, there are more subdirs with =
hashed backupIDs.&nbsp; Under</FONT>
<BR><FONT SIZE=3D2>there, there are files, one header file, and one =
filelist (the filelist</FONT>
<BR><FONT SIZE=3D2>has a .f extension).&nbsp; The filelist looks like =
this:</FONT>
</P>

<P><FONT SIZE=3D2>0 0 1 51 0 0 0 0 8388608 / 16877 root other 0 =
1008868013 1007744410 1007744410</FONT>
<BR><FONT SIZE=3D2>0 0 9 50 1 0 0 0 46399504 /disk751/ 16877 root root =
0 1008879253 1007658552 1007658552</FONT>
<BR><FONT SIZE=3D2>0 0 15 51 2 0 0 0 46399504 /disk751/atest/ 16893 =
atest 9990 0 1008879253 1008879235 1008879235</FONT>
<BR><FONT SIZE=3D2>0 0 19 51 3 0 0 0 46399504 /disk751/atest/OUT/ 16893 =
atest 9990 0 1008879253 1008879223 1008879223</FONT>
<BR><FONT SIZE=3D2>1 0 38 50 4 1 0 0 46399504 =
/disk751/atest/OUT/bk_bant_000392_44k/ 16893 atest 9990 0 1008879228 =
992343637 1008879228</FONT>
<BR><FONT SIZE=3D2>2 0 65 56 5 1 0 0 46399504 =
/disk751/atest/OUT/bk_bant_000392_44k/bk_bant_000392_rev1_pi2.wav 33277 =
atest 9990 1949818 1008861520 992343602 1008879228</FONT></P>

<P><FONT SIZE=3D2>...</FONT>
</P>

<P><FONT SIZE=3D2>I can figure out the filename, user and group, and I =
think the field</FONT>
<BR><FONT SIZE=3D2>after group ID is the file size.</FONT>
</P>

<P><FONT SIZE=3D2>I'll be emailing Veritas as well, and I'll let you =
know what they say.</FONT>
</P>

<P><FONT SIZE=3D2>-Adam</FONT>
</P>

<P><FONT SIZE=3D2>Adam Levin, Senior Unix Systems Administrator | <A =
HREF=3D"http://www.audible.com/"; =
TARGET=3D"_blank">http://www.audible.com/</A></FONT>
<BR><FONT SIZE=3D2>Audible, Inc.</FONT>
<BR><FONT SIZE=3D2>Wayne, NJ, =
07470&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; In purple, I'm =
stunning.</FONT>
<BR><FONT =
SIZE=3D2>973-837-2797&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
</FONT>
</P>

<P><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>Veritas-bu maillist&nbsp; -&nbsp; =
Veritas-bu AT mailman.eng.auburn DOT edu</FONT>
<BR><FONT SIZE=3D2><A =
HREF=3D"http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu"; =
TARGET=3D"_blank">http://mailman.eng.auburn.edu/mailman/listinfo/veritas=
-bu</A></FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C1E7C5.C3D515E0--

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