Networker

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

2007-04-06 12:01:16
Subject: Re: [Networker] Simple UNIX Clone script - for use by community (UPDATED)
From: George Sinclair <George.Sinclair AT NOAA DOT GOV>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Fri, 6 Apr 2007 11:57:25 -0400
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