Veritas-bu

[Veritas-bu] Reconciling Existing Images With a New RetentionPeriod

2001-01-22 16:29:12
Subject: [Veritas-bu] Reconciling Existing Images With a New RetentionPeriod
From: Ravi Channavajhala ravi.channavajhala AT csfb DOT com
Date: Mon, 22 Jan 2001 16:29:12 -0500 (EST)
Hi Dennis,

Here's the breakdown of the fields, I'm also enclosing skeleton PERL
code below.  HTH.

IMAGE line
==========

client
DBversion
BackupID
Class
ClientType
ScheduleLable
ScheduleType
RetentionLevel
No.OfFiles
Expiration
Compression
Encryption

The FRAG line if I understand it correctly, if backup spans over multiple
tapes, typically what happens when MPX is turned on.  Also, you may want
to inquire the media to see if it contains only WEEKLY_FULL images and
nothing else

FRAG line
=========
ImageCopyNumber
FragmentNumber
KBinFragment
Remainder = (bytes written % 1024)
MediaType
Density
FileNumber
MediaID
Host
BlockSize
Offset
MediaDate
DeviceLunWritten
f_flags (If using blockmap)
F_unused
Expiration
Multipex

You can also try using bpimagelist per client, if you know all the clients
and try something similar to this

/usr/openv/netbackup/bin/admincmd/bpimagelist -client <CLIENT> -d <DATE>
-e <DATE>, this also shows expiration date and additional information

I'm giving a skeleton PERL script below, please use at your own risk.
I hope this give you idea as what is going on...I'm using bpimmedia
in this.

### Begin Code segment ####

print "\n\nAvailable Media and the expiry dates:";
        my 
(@NbImMediaList,$NbImMedia,@NbImTmp,$NbImID,$NbImClass,$NbImType,$NbImTyp,
                $NbImFiles,$NbImExp,$NbCnt);
        @NbImMediaList=`$NbAdmDir/bpimmedia -client $Machine 2>/dev/null`;

        if ($#NbImMediaList < 0) {
                print "\n*****\tNo BP Media information for this
client\t*****";
        } else {
                        printf("\n%-20s%-20s%-5s%-10s%-20s",

"BackupID","Class","Type","Files","Expiration");
                        printf("\n%-20s%-20s%-5s%-10s%-20s",

"--------","-----","----","-----","----------");
                        $NbCnt=0;
                        foreach $NbImMedia (@NbImMediaList) {
                                chomp($NbImMedia);
                                @NbImTmp=split(/\s+/,$NbImMedia);
                                if ($NbImMedia =~ /^IMAGE/) {
                                        $NbCnt=0;
                                        $NbImID=$NbImTmp[3];
                                        $NbImClass=$NbImTmp[4];
                                        $NbImType=$NbImTmp[5];
                                        $NbImTyp=$NbImTmp[7];
                                        $NbImFiles=$NbImTmp[9];

$NbImExp=Get_Time_String($NbImTmp[10]);

printf("\n\n%-20s%-20s%-5s%-10s%-20s\n",

$NbImID,$NbImClass,$NbImType,$NbImFiles,$
NbImExp);
                                }
                                if ($NbImMedia =~ /^FRAG/) {
                                        if ($NbCnt == 0) {

printf("\n\t%-5s%-5s%-10s%-15s%-15s%-5s",
"Cp","Fg","KB","Server","MediaID"
,"MPX");

printf("\n\t%-5s%-5s%-10s%-15s%-15s%-5s",
"----","----","----","------","--
--------","-----");
                                        }
                                        $NbCnt++;
                                        $NbFragCp=$NbImTmp[1];
                                        $NbFragNo=$NbImTmp[2];
                                        $NbFragKB=$NbImTmp[3];
                                        $NbFragMID=$NbImTmp[8];
                                        $NbFragSrv=$NbImTmp[9];

$NbFragExp=Get_Time_String($NbImTmp[16]);
                                        $NbFragMPX=$NbImTmp[17];

printf("\n\t%-5s%-5s%-10s%-15s%-15s%-5s", 
$NbFragCp,$NbFragNo,$NbFragKB,$NbFragSrv,
$NbFragMID,$NbFragMPX);

sub Get_Time_String {
        my ($Time)=@_;
        my ($Tm,$FDate);
        $Tm=localtime($Time);
        $FDate=sprintf("%02d/%02d/%4d %02d:%02d:%02d",

$Tm->mon+1,$Tm->mday,$Tm->year+1900,$Tm->hour,$Tm->min,$T
m->sec);
        return($FDate);
}

sub print_dashes {
        my($char,$count)=@_;
        my $line=($char)x($count);
        print $line,"\n";
        return(0);
}

-ravi

On Mon, 22 Jan 2001, Dennis Dwyer wrote:

dfdwye>Ravi,
dfdwye>
dfdwye>Thanks for the information. Perhaps you could clarify
dfdwye>something for me. When I issue the bpimmedia command for a
dfdwye>CLASS and a SCHEDULE I receive an IMAGE line with
dfdwye>information as well as one or more FRAG lines. All these
dfdwye>lines contain dates but I'm assuming your reference is to
dfdwye>the FRAG lines because the field numbers you mentioned (9 &
dfdwye>13) seem to work out on that one. My concern is that the
dfdwye>date represented in field 17 (it may be 18) on the FRAG line
dfdwye>tends to be well past the date represented in field 13. Is
dfdwye>there any documentation available for these fields? I find
dfdwye>that the command itself is also undocumented. I am running
dfdwye>NBU 3.2 by the way. I gotta be sure I get this right so I
dfdwye>don't expire something that shouldn't be expired. I also
dfdwye>have an issue with multiple images on a single tape that may
dfdwye>not all expire at the same time so I might want to expire
dfdwye>the images rather the media (if that's possible). Granted,
dfdwye>they are all the same retention period (6 weeks) but some
dfdwye>images may be newer than others and were appended to that
dfdwye>tape because it was the correct retention period and had
dfdwye>space available.
dfdwye>
dfdwye>Regards,
dfdwye>Dennis
dfdwye>
dfdwye>Quote: "Time is not a test of the truth"
dfdwye>Translation: Just because you've always done it that way, doesn't make 
it right
dfdwye>
dfdwye>Dennis F. Dwyer
dfdwye>Enterprise Storage Manager
dfdwye>Tampa Electric Company
dfdwye>
dfdwye>(813) 225-5181  - Voice
dfdwye>(813) 275-3599  - FAX
dfdwye>
dfdwye>Visit our corporate website at www.tecoenergy.com
dfdwye>
dfdwye>>>> Ravi Channavajhala <ravi.channavajhala AT csfb DOT com> 01/22/01 
11:50AM >>>
dfdwye>Dennis,
dfdwye>
dfdwye>Easiest way is to write a script to do this, identify the media ids
dfdwye>by using
dfdwye>
dfdwye>/usr/openv/netbackup/bin/admincmd/bpimmedia -class <WEEKLY_FULL>
dfdwye>and look for the expires column.
dfdwye>
dfdwye>The field 13, is the expiration date and the field 9 is the tape ID,
dfdwye>I think.
dfdwye>
dfdwye>Then run the list of identified media IDs thru bpexpdate -ev <media_id>
dfdwye>-d 0.
dfdwye>
dfdwye>-ravi
dfdwye>
dfdwye>On Mon, 22 Jan 2001, Dennis Dwyer wrote:
dfdwye>
dfdwye>dfdwye>I just changed all retention periods in all classes for my
dfdwye>dfdwye>weekly FULL backups from 6 weeks to 5 weeks. What I'd like
dfdwye>dfdwye>to do now is go out and force any tapes that contain images
dfdwye>dfdwye>older than 5 weeks to expire. Is there an easy way to do
dfdwye>dfdwye>this or do I just have to wait for natural attrition?
dfdwye>dfdwye>
dfdwye>dfdwye>Regards,
dfdwye>dfdwye>Dennis
dfdwye>dfdwye>
dfdwye>dfdwye>Quote: "Time is not a test of the truth"
dfdwye>dfdwye>Translation: Just because you've always done it that way, doesn't 
make it right
dfdwye>dfdwye>
dfdwye>dfdwye>Dennis F. Dwyer
dfdwye>dfdwye>Enterprise Storage Manager
dfdwye>
dfdwye>
dfdwye>




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