Re: Move DRM question
2001-08-01 16:30:34
Here are some AIX ksh commands, adapt as needed:
to get a list of tapes to remove:
dsmadmc -id=query -password=query q actlog begint=08:00 endt=08:40 | grep -i
"from slot" | sed "s/ / /g" | sed "s/ / /g" | sort -t" " +9 -n >$OUTPUT_FILE
To get a list of tapes to retrieve:
dsmadmc -id=query -password=query select volume_name as \"Volume Name\", STATE
as \"Volume Sate\", UPD_DATE as \"Last Update Date\ \ \ \ \ \ \ \ \ \ \" from
drmedia whe
re STATE=\'VAULTRETRIEVE\' order by UPD_DATE | grep -v ANS8000I | grep
VAULTRETRIEVE >$OUTPUT_FILE
If you like I can send the *real* scripts.
Miles
I have full scripts, that produce scripts, to check in and remove tapes. The
scripts produce scripts that look like this:
echo $0 started at $(date).
SEP="-----------------------------------------------------------------"
clear
if [[ $LOGNAME != '' && $LOGNAME != 'root' ]]
then
echo "Please enter your ADSM id [$LOGNAME]: \c"
read ID
if [[ $ID = '' ]]
then
ID=$LOGNAME
fi
else
echo "Please enter your ADSM id: \c"
read ID
fi
while [[ $ID = '' ]]
do
echo "Please enter your ADSM id: \c"
read ID
done
echo "Please enter your ADSM password: \c"
stty -echo
read PASSWORD
stty echo
echo
clear
echo $SEP
echo "The following tapes will have their status updated:"
echo $SEP
echo 08/01/01 08:10:57 ANR8829I Remove volume 024D1C from slot 32 of library
echo 08/01/01 08:11:24 ANR8829I Remove volume 025DD5 from slot 33 of library
echo 08/01/01 08:11:53 ANR8829I Remove volume 025EA7 from slot 34 of library
echo 08/01/01 08:12:20 ANR8829I Remove volume 072BE9 from slot 35 of library
echo 08/01/01 08:12:48 ANR8829I Remove volume 07992A from slot 36 of library
echo 08/01/01 08:13:17 ANR8829I Remove volume 07996E from slot 37 of library
echo 08/01/01 08:13:44 ANR8829I Remove volume 079BF6 from slot 38 of library
echo 08/01/01 08:14:13 ANR8829I Remove volume 054E93 from slot 39 of library
echo 08/01/01 08:14:43 ANR8829I Remove volume 078CD4 from slot 40 of library
echo $SEP
echo Count of Magstar tapes to update: 9
echo $SEP
echo
echo "If these are not the cartridges that you just removed, hit Ctrl-C now."
echo "Or else hit enter to continue."
read DUMMY
echo
echo "Now updating the DRM status..."
dsmadmc -id=$ID -password=$PASSWORD move drmedia 024D1C tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 025DD5 tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 025EA7 tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 054E93 tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 072BE9 tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 078CD4 tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 07992A tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 07996E tostate=vault | grep -i
return
dsmadmc -id=$ID -password=$PASSWORD move drmedia 079BF6 tostate=vault | grep -i
return
echo $0 ended at $(date).
-------------------------------------------------------------------------------------------
----------------
Miles Purdy
Miles Purdy
System Manager
Farm Income Programs Directorate
Winnipeg, MB, CA
purdym AT fipd.gc DOT ca
ph: (204) 984-1602 fax: (204) 983-7557
-------------------------------------------------------------------------------------------
----------------
>>> fred AT MIDWAY.UCHICAGO DOT EDU 01-Aug-01 10:53:19 AM >>>
>>> fred AT MIDWAY.UCHICAGO DOT EDU 01-Aug-01 10:53:19 AM >>>
I'm trying to get DRM commands installed for operations staff. The desired
method is for an operator to issue a command from the console which is a
local script, in this case copied straight out of the TSM
documentation. The server is running AIX 4.3.3 and the script is Korn-shell.
This is what appears in the activity log when the script is run.
08/01/2001 10:42:26 ANR2017I Administrator ADMIN issued command: MOVE DRMEDIA
UC* wherest=vaultretrieve tost=onsiteretrieve
cmdf=/var/adm/dsm/drmcmd.dsm cmd=checkin libvol= tsmlib=
&vol= devt=3590 stat=scratch
08/01/2001 10:42:26 ANR2020E MOVE DRMEDIA: Invalid parameter - LIBVOL.
08/01/2001 10:43:35 ANR2017I Administrator FRED issued command: QUERY ACTLOG
s=drm
08/01/2001 10:44:39 ANR2017I Administrator ADMIN issued command: MOVE DRMEDIA
UC* wherest=vaultretrieve tost=onsiteretrieve
cmd=checkin
libvol= tsmlib= &vol= devt=3590 stat=scratch
08/01/2001 10:44:39 ANR2020E MOVE DRMEDIA: Invalid parameter - LIBVOL.
I have a feeling that this is more an AIX problem than TSM, but has anyone
got this to work?
|
|
|