ADSM-L

Re: Antwort: Generating "dismount volume" commands

1999-11-05 03:07:37
Subject: Re: Antwort: Generating "dismount volume" commands
From: Russell Street <russells AT AUCKLAND.AC DOT NZ>
Date: Fri, 5 Nov 1999 21:07:37 +1300
Alas there is no SQL table in ADSM with the mounted volumes listed.

I wrote a shell-script to look at the output of "query mount" and
dismounts them.

Works 99% of the time.  The 1% is the race condition between the query
and the dismounts.  There is a small gap the server can internally
issue a "dismount volume" or some process or session starts to use the
volume.  This just leads to an error message.  Conversely, a volume
can become idle in the gap and it will be missed.

Russell


#!/bin/sh
## =================================================================
## File: adsm-dismount-idle --- dismount all IDLE mounted tapes
##
## Author:  Russell Street <r.street AT auckland.ac DOT nz>
##          ITSS, University of Auckland
##
##
## =================================================================

admin_login=whatever
admin_pass=notlikely

VOLS=`/usr/bin/dsmadmc -id=$admin_login -pass=$admin_pass \
        query mount |
        nawk '$0 ~ /IDLE/ {print $4}'`

for i in ${VOLS} ; do
  /usr/bin/dsmadmc -id=$admin_login -pass=$admin_pass \
       dismount volume $i |
  egrep -v "^ADSTAR|^Command|^\(C\)|^Session|^  Server|^$|ANS8001I|ANS8002I"

done


## End of file: adsm-dismount-idle
## =================================================================
<Prev in Thread] Current Thread [Next in Thread>