Networker

Re: [Networker] Simple UNIX Clone script - for use by community (UPDATED)

2007-04-06 13:19:10
Subject: Re: [Networker] Simple UNIX Clone script - for use by community (UPDATED)
From: "Reed, Ted G [IT]" <Ted.Reed AT SPRINT DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 6 Apr 2007 12:13:12 -0500
        Good point in using ssflags as a saveset health check.  How would you 
code to vet the ssflags as kosher before the nsrclone portion?  The 
'!incomplete' just means not incomplete savesets.....so currently running jobs 
(in-progress) and aborted jobs are not duplicated, only finished savesets.  But 
we don't make any checks on ssflags other than the inferred "it can't have an 
'i' or 'I' in ssflag" inherent in the !incomplete.  So it would clone 
regardless of pre-set suspect status (as you describe in your email), but I 
would want it to have that behaviour.  If it fails at cloning, I'd rather have 
the failure and see it so I know to check the original saveset/media for errors.

        We have a total of ~120 otherwise-valid-but-listed-as-suspect savesets 
(vF, vrEF, etc), of which 26 are on Clone media, the other 95 or so are in the 
BR Pool.....and many are spanned volumes so a single suspect saveset may mark 
suspect as many as a dozen volume references.  So that implies that during the 
read back of saveset for clone creation, there was a read-error on the original 
tape.  But that'd usually never come to light if we didn't run the clone.  And 
even so, the copy is not necessarily suspect.  For example, the below is a case 
where the original is marked suspect (due to some read error on one of the 
tapes) but the clone is not....and I'd believe it's fully recoverable, if not 
both original and clone recoverable.
         volume        client     pool           ssid       ssflags clflg
        M20760         pdahlb01z  BR Pool        1023713736 vF     s
        M20824         pdahlb01z  BR Pool        1023713736 vF     s
        M21834         pdahlb01z  Clone Vault TX 1023713736 vF     
        M21874         pdahlb01z  Clone Vault TX 1023713736 vF     
        M21935         pdahlb01z  BR Pool        1023713736 vF     s

        Also, are you sure a failed clone will result in a copy count increase? 
 That should only be true if it was successful, else there isn't multiple 
copies.  Thanks much for the feedback.  I've seen your threads and commentary 
for a long time on the list and very much welcome your input.  Thanks again.
--Ted


-----Original Message-----
From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] On 
Behalf Of George Sinclair
Sent: Friday, April 06, 2007 10:57 AM
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Subject: Re: [Networker] Simple UNIX Clone script - for use by community 
(UPDATED)

Shouldn't you also be checking the ssflags and clflags values for the original 
save sets before cloning them? I've seen cases where an original save set was 
marked 'suspect' even though it had never been read during a clone operation. 
I've seen cases, too, where a save set completed (no abort) but whose ssflags 
suggested a something was awry. I would want to ensure that the ssflags were 
golden before I started a clone on it. Is this what the '!incomplete' flag is 
accomplishing? Also, what if the save set was previously cloned but not 
successfully?
It's value for 'copies' would be >= 2 but would still need to be cloned again, 
obviously to a different volume unless 'nsrmm -d -S ssid/cloneid' 
was run.

George

Reed, Ted G [IT] wrote:
> Is it Monday again.  Arghhhh.....here's the final, really right version.  
>
> mminfo -omo -r ssid -q "!incomplete,pool=BR 
> Pool,copies=1,level=full,location='$JB'" -t "$TIME" > $LOG_DIR.$JB
>
>  
>
> -----Original Message-----
> From: Reed, Ted G [IT]
> Sent: Friday, April 06, 2007 10:26 AM
> To: 'EMC NetWorker discussion'; Reed, Ted G [IT]
> Subject: RE: [Networker] Simple UNIX Clone script - for use by 
> community (UPDATED)
>
> Sorry folks, I cut/pasted an old, nonworking version of the mminfo (bad 
> quotation management for variable interpretation).  Here's the RIGHT version. 
>  So the script below, plus this fix, equals working UNIX script again.
>
> mminfo -omo -r ssid -q "!incomplete,pool=BR 
> Pool,copies=1,level=full,location='$SN'" -t "$TIME" > $LOG_DIR.$SN
>
>
>
> -----Original Message-----
> From: EMC NetWorker discussion [mailto:NETWORKER AT LISTSERV.TEMPLE DOT EDU] 
> On Behalf Of Reed, Ted G [IT]
> Sent: Thursday, April 05, 2007 11:29 AM
> To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
> Subject: Re: [Networker] Simple UNIX Clone script - for use by 
> community (UPDATED)
>
> NOTE:  Outlook likes to remove "extra" line breaks sometimes.....which is 
> really bad for scripting.  Be sure you check to see if it says "Extra line 
> breaks in this message were removed", and if it does, click on the message 
> and "Restore line breaks".  Otherwise, some of the code gets mangled.  Thanks.
> --Ted
>
> I'd like to thank Conrad Macina for providing an elegant piece of code to 
> replace the ugly 'echo "JUKEBOXNAME" >> FILE' hard code repeats we had in 
> place to list all defined jukeboxes.  Why edit when you can look it up and 
> maintain dynamic functionality? 
> PS.  Reminder that the 'pool=BR Pool' in the mminfo call and the '-b "Clone 
> Vault TX"' in the nsrclone are both specific to my environment and should be 
> edited to meet your environment's needs.  See previous thread entries for 
> greater detail.
> ----------BEGIN CODE----------
>
>
> #!/bin/ksh
> #
> # Name: clone_script.sh
>
> #*******************
> # Script Variables *
> #*******************
> LOG_DIR="./ssid"
> JB_NAMES="./JB_NAMES"
> TIME="one week ago"
>
> #*********************************************************************
> ************************* # Change directory used because ps -ef 
> output was too long and was breaking the if statement. *
> # By using the change directory we shorten the ps -ef output to manageable 
> length             * 
> #*********************************************************************
> *************************
> cd /usr/local/Legato/clone
>
> #**************************************************
> # This writes the jukebox names into a text file. *
> #**************************************************
> echo "show name \n print type:nsr jukebox" | nsradmin -i - | grep 
> "name:" | awk '{print $NF}' | tr -d '";' | sort > $JB_NAMES
>
> #*********************************************************************
> *************************************
> # Verifies the last nsrhost has finished.  Want clone to include most 
> recent master backup and bootstrap. *
> #*********************************************************************
> *************************************
> while ps -ef | grep nsrhost | grep -v grep do
>   sleep 300
> done
>
> #*********************************************************************
> *****************************************
> # Section to check for running clones, if not generate list of save 
> sets to be cloned and executes the clone. *
> #*********************************************************************
> *****************************************
> for JB in $(cat $JB_NAMES)
> do
>   if ! ps -ef | grep nsrclone | grep $JB | grep -v grep > /dev/null
>   then
>       mminfo -omo -r ssid -q '!incomplete,pool=BR 
> Pool,copies=1,level=full,location=$JB' -t $TIME > $LOG_DIR.$JB
>       nsrclone -b "Clone Vault TX" -S -f $LOG_DIR.$JB &
>   fi
> Done
>
> ----------END CODE----------
>
> To sign off this list, send email to listserv AT listserv.temple DOT edu and 
> type "signoff networker" in the body of the email. Please write to 
> networker-request AT listserv.temple DOT edu if you have any problems with 
> this list. You can access the archives at 
> http://listserv.temple.edu/archives/networker.html or via RSS at 
> http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
>
> To sign off this list, send email to listserv AT listserv.temple DOT edu and 
> type "signoff networker" in the body of the email. Please write to 
> networker-request AT listserv.temple DOT edu if you have any problems with 
> this list. You can access the archives at 
> http://listserv.temple.edu/archives/networker.html or via RSS at 
> http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
>
>   


--
George Sinclair - NOAA/NESDIS/National Oceanographic Data Center
SSMC3 4th Floor Rm 4145       | Voice: (301) 713-3284 x210
1315 East West Highway        | Fax:   (301) 713-3301
Silver Spring, MD 20910-3282  | Web Site:  http://www.nodc.noaa.gov/
- Any opinions expressed in this message are NOT those of the US Govt. - 

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or via RSS at 
http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER

To sign off this list, send email to listserv AT listserv.temple DOT edu and 
type "signoff networker" in the body of the email. Please write to 
networker-request AT listserv.temple DOT edu if you have any problems with this 
list. You can access the archives at 
http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER