TSM: Lost Tapes

We had an issue not long ago were Tivoli Storage Manager was losing track of tapes. The issue ended up being how TSM manages database snapshots which are sent offsite using DRM (Bug in TSM which has been around for a while according to a colleague of mine).

I needed to find out quickly which tapes TSM had no knowledge of, and had essentially become scratch. I wrote the following script to do just that for me. You’ll need to tailor it to your environment, as our tapes are bar-coded COL000L4 through to COL120L4.

#!/usr/bin/ksh
 
dsmadmc="/usr/bin/dsmadmc -id=username -pass=password -dataonly=yes -displ=lis"
count=0
zero=00
 
echo "The following tapes do not exist in TSM:"
while (( $count <= 120 )); do
        if [ $count -gt 9 ]; then
        let zero=0
        fi
 
        if [ $count -gt 99 ]; then
        unset zero
        fi
 
        $dsmadmc q volume ???${zero}${count}?? > /dev/null 2>&1
        if [ $? -ne 0 ]; then
        echo COL${zero}${count}L4
        fi
 
        let count="count + 1"
 
done
exit

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.