Networker

[Networker] Selecting the first tape an nsrclone will need

2008-10-14 01:23:24
Subject: [Networker] Selecting the first tape an nsrclone will need
From: tkimball <networker-forum AT BACKUPCENTRAL DOT COM>
To: NETWORKER AT LISTSERV.TEMPLE DOT EDU
Date: Tue, 14 Oct 2008 01:20:24 -0400
Francis Swasey wrote:
> 
> So, my question is:  What is the best algorithm to use to determine 
> which ssid will be the first one NetWorker will decide to clone from a 
> list of ssid's.    My current algorithm is picks the first tape from the 
> ssid that has the earliest start time.  This morning, that didn't work 
> and NetWorker mounted a different tape -- so, obviously, my algorithm 
> isn't the best.
> 
> Is anyone else doing scripted cloning and using an algorithm to 
> pre-mount the first source tape to force where the cloning happens?
> 


I'm doing something like that, but it's a bit convoluted:

1) Grab a listing of SSID/volume pairs + flags
2) generate summary data containing # of complete and 'head' savesets for each 
volume
3) mount each volume in series, with the first volume being the one with the 
most full (then the most 'head' SSIDs).  Kick off the clone of that listing.
4) sleep 10 mins (allow ejects) and repeat #3 until all tapes done.

I determine 'what source pool mounts to what SN' by a config file that is 
referenced; It includes an approximate number of hosts that should be in the 
backup, so we know (in theory) if there's a miscount someplace.

Having a config file for what SN the tapes mount to, allow me to switch systems 
if a drive has failed on one of them (we only have two LTO on each of Server 
and SN right now).

I'm posting the relevant portion of the script below.  Warning, its in csh.  ;)

--TSK

-----=====-----


/usr/sbin/nsr/mminfo -r "volume,ssid,sumflags" -q 
"pool=$&#123;pool&#125;,incomplete=false,suspect=false,savetime> $timeframe 
16&#58;00,copies=1" | egrep 'cb|hb|cr' > $temp1


set vol_list = `cat $temp1 | nawk '&#123;print $1&#125;' | sort -u`

cat /dev/null > $temp2
foreach vol &#40;$vol_list&#41;
&nbsp; &nbsp;@ c_cnt = 0
&nbsp; &nbsp;@ h_cnt = 0
&nbsp; &nbsp;@ c_cnt = `grep $vol $temp1 | egrep 'cb|cr' | wc -l`
&nbsp; &nbsp;@ h_cnt = `grep $vol $temp1 | grep hb | wc -l`
&nbsp; &nbsp;echo "$vol&nbsp; &nbsp;$c_cnt&nbsp; $h_cnt" >> $temp2
end

set vol_order = `cat $temp2 | sort -nr -k 2 -k 3 | nawk '&#123;print $1&#125;'`


+----------------------------------------------------------------------
|This was sent by t.s.kimball AT gmail DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------

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