Kristijan.org

I’m back!

Posted by Kristijan on Sunday, December 21st, 2008

How could I stay away? From the shear number of e-mails flooding my inbox daily for updates to my infamous blog, I couldn’t keep the fans in the dark no more!
*cough*
Back to reality…I’m not reviving my old blog, but starting a new one. I’ve been working as a systems administrator for about 4 years now, [...]

continue reading

TSM: Lost Tapes

Posted by Kristijan on Wednesday, September 30th, 2009

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

Posted in: Shell Scripting.

Leave a Reply