Trying to write a blank tape count script
Updated: 21 May 2010 | 10 comments
This issue has been solved. See solution.
Hello all,
I'm trying to write a blank tape count script that will email the blank tape count out daily. Any suggestions on how to do this? Which commands should I use to get that information? available_media? bpmedialist?
Thanks,
GT
discussion Filed Under:
Comments
vmquery
You can use the vmquery command and then do basic text manipulation to extract fields and numbers.
vmquery -pn Scratch -b
.
Bob Stump VERITAS - "Ain't it the truth?" Incorrigible punster -- Do not incorrige
Thanks for the reply. I'll
Thanks for the reply. I'll try that. I just need to figure out why I have tapes with multiple mounts still in the scratch pool.
Thanks,
GT
Probably because they got put
Probably because they got put back into scratch when they expired. =)
- "Your backups are only as good as your restores."
tapes with multiple mounts in scratch pool
If a tape is written to and all of the images expire then the tape is placed back into the scratch pool and will show as having been mounted multiple times. each image on the tape may increase the number of mounts for that tape. it is normal to see multiple mounts having been made on a tape that is sitting in the scratch pool.
Bob Stump VERITAS - "Ain't it the truth?" Incorrigible punster -- Do not incorrige
I can't believe I beat Bob to
I can't believe I beat Bob to an answer by 15 seconds. heh. =)
- "Your backups are only as good as your restores."
Yep, they had expired images
Recalled the tapes. Except for some test runs, most were 1 week retention catalog backups. Put them back in the library and they got re-used.
Thanks,
-GT
Thanks for the responses. I'm
Thanks for the responses.
I'm not sure that is the case for some of them because some of them are still in my robot and show multiple mounts but are still in the scratch pool. We are on infinite retention, but I do manually expire images every once in a while, but haven't expired any tape images for quite some time, just D2D images.
bash-3.00# vmquery -pn scratch -b
media media robot robot robot side/ optical # mounts/ last
ID type type # slot face partner cleanings mount time
-------------------------------------------------------------------------------
L00000 HCART3 NONE - - - - 594 06/03/2009 10:01
L00051 HCART3 NONE - - - - 29 12/01/2008 00:18
L00106 HCART3 NONE - - - - 11 12/11/2008 00:33
L00220 HCART3 NONE - - - - 29 02/04/2009 00:39
L00462 HCART3 NONE - - - - 22 05/04/2009 00:44
L00712 HCART3 TLD 0 13 - - 17 07/21/2009 00:48
L00777 HCART3 NONE - - - - 22 11/03/2008 00:28
L00816 HCART3 NONE - - - - 6 06/26/2009 06:01
L00888 HCART3 TLD 0 69 - - 2 07/20/2009 22:53
If you want to reset scratch tape to zero mounts
vmchange [-h <EMM_server> | <volume_database_host>]
-n <num_mounts> -m <media_id>
Again, "It is normal for a scratch tape to have multiple mount counts"
You know you get a mount request if
1. you write an image
2. you restore an image
3. you duplicate an image
4. you verify an image
5. .....
Bob Stump VERITAS - "Ain't it the truth?" Incorrigible punster -- Do not incorrige
Thanks for the help
I'm going to recall all of the tapes and run a tape contents report on
them and figure out what if anything they have on them and why they
are still in the scratch pool after supposedly being marked full,
removed from the library, and moved offsite.
Thanks for the vmquery command, that should be exactly what I need to write the blank tape script.
pure example:
Looking at scratch pool may not work.
Other customers have typically may have more than 1 scratch pool, etc.
What you want to know is if tapes have an assigned time or not. De-assigned tapes are the ones that would be re-usable for future backups.
However, just basing off it wont work, you have to ensure they are not cold catalog backup tapes, or cleaning tapes.
remember, example only. test/use at own risk! plus copy-and-paste may ruin some translation!
#!/bin/sh
allpools=`/usr/openv/volmgr/bin/vmpool -listall -bx | egrep -v "pool index|-------------" | awk '{print $1 " " $2}'`
# list list of cold catalog backup tapes
catalogtapes=`/usr/openv/netbackup/bin/admincmd/bpsyncinfo -l | grep SYNCSERV | awk '{print $3 " " $4 " "}'`
echo ""
echo " List of DE-ASSIGNED Volumes as of `date '+%m-%d-%y'` `date '+%H:%M:%S'`"
echo "================================================================================"
printf " MEDIAID BARCODE \tTYPE\tRobotic\tVOLUME POOL\tOTHER INFO\n"
echo "--------------------------------------------------------------------------------"
vmpool -listall -bx | egrep -v "pool index|-------------" | awk '{print $1 " " $2}' |
while read name number
do
vmquery -p $number -l | grep -v "''" | awk '{print $1 " " $4 " " $3 " " $8 " " $20 " " $21 " " $13 " " $7 }' |
while read mediaid barcode mediatype slotnumber assigndate assigntime poolnumber robtype
do
if [ "$assigndate" = "00/00/0000" ]; then
isCLN=`echo $mediatype | grep -i cln`
if [ "$isCLN" = "" ]; then
echo $catalogtapes |
while read clnmedia1 clnmedia2 clnmedia3 clnmedia4
do
inRobot="Yes "
otherINFO=""
if [ "$clnmedia1" = "mediaid" ]; then
clnmedia=yes
elif [ "$clnmedia2" = "mediaid" ]; then
clnmedia=yes
elif [ "$clnmedia3" = "mediaid" ]; then
clnmedia=yes
elif [ "$clnmedia4" = "mediaid" ]; then
clnmedia=yes
else
if [ "$barcode" = "-" ]; then
barcode=" -- "
fi
if [ "$slotnumber" = "-" ]; then
inRobot="No "
slotnumber=""
else
inRobot="Yes "
otherINFO="Robot: $robtype; Slot: $slotnumber"
if [ "$robtype" = "ACS" ]; then
otherINFO="Robot: $robtype; Slot: N/A"
fi
fi
printf " $mediaid $barcode \t$mediatype \t$inRobot\t$name \t$otherINFO\n"
fi
done
fi
fi
done
done
echo ""
exit;
Would you like to reply?
Login or Register to post your comment.