Well, just remember that if you want to cancel either a
session or a process, you can't have any commas in the number so you can't just
do a query & cut the number out.
Here is an example of how I deal with process
numbers
#!/bin/ksh
for PROCNUM in $(dsmadmc -id=someid -pass=somepass q pro | cut -c1-8 | grep ^' ' | grep [0-9] )
do
echo $PROCNUM | grep , 1>/dev/null 2>&1
if [ $? -eq 0 ] ; then
FIRST=$(echo $PROCNUM | cut -d',' -f1)
SECOND=$(echo $PROCNUM | cut -d',' -f2)
PROCNUM=$FIRST$SECOND
fi
echo dsmadmc -id=someid -pass=somepass cancel process $PROCNUM
done
exit
for PROCNUM in $(dsmadmc -id=someid -pass=somepass q pro | cut -c1-8 | grep ^' ' | grep [0-9] )
do
echo $PROCNUM | grep , 1>/dev/null 2>&1
if [ $? -eq 0 ] ; then
FIRST=$(echo $PROCNUM | cut -d',' -f1)
SECOND=$(echo $PROCNUM | cut -d',' -f2)
PROCNUM=$FIRST$SECOND
fi
echo dsmadmc -id=someid -pass=somepass cancel process $PROCNUM
done
exit
so
just change the above to do a "q session" and grep for your node name(s) and cut
the first 6 characters and use that to cancel the
sessions....
now if
your sessions get above 99,999 you will have problems because the session number
itself will be across two lines of output...
hope
this helps
later
dwight
-----Original Message-----
From: Niklas Lundstrom [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 29, 2001 6:29 AM
To: [EMAIL PROTECTED]
Subject: Script to cancel certain sessionsHello TSM:ersI'm trying to write a script that should cancel the sessions for certain servers if their backup still runs at 9 am but I'm stuck. How can I do that? It should be automated by a command script.RegardsNiklas LundströmFöreningssparbanken IT08-5859 5164