Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to completely delete a networker client? 1

Status
Not open for further replies.

Cile1

Technical User
Aug 28, 2003
7
0
0
SE
Hi,
I have 2 questions:

1. How to completely remove a networker client
(Ver 6.x on Windows)& it's id,media index, etc..)?Most important is that client release the tape usage imedietly, towards the retention policy that controll how long entries are retained in the media index.

2.How to find easy client's group membership (some command)?

Thanks!
 
You have to wait until the retention expire to get those tapes recycled. unless you force it using nsrmm.

 
Well, of course you have the option to relabel the tapes
immediately.

To remove a client properly
- delete his resources
- delete his \nsr\index\client_name directory

How many client instances do you have? It should be very
easy from the client configuration window.

 
"nsrmm" is the way to go to set all savesets associated with the client to recycleable, then delete the client from the client drop-down. Removing the client from "/nsr/index" does not help with the media database and the associated savesets stay in the same state forever.
 
Thanks all for the tips!

I have ca 900 clients and some scripts should be the best way to completely delete a client.

What about the second question?
 

This will only cause problems if you have a lot of multiple
instances for the same client. However, usually, one will
just have 2 or 3. I do not really see a problem - just open
those instances and find out.

Of course you also could nwadmin but this is a bit more
complicated. Use something like this:

C:\>nsradmin
NetWorker administration program.
Use the "help" command for help.
nsradmin> show group
nsradmin> show name
nsradmin> print type: nsr client
group: Default, Test;
name: xxx;
nsradmin>quit

C:\>

 

This is how I do it

#!/usr/bin/ksh
# ###############################################################################
#AUTHOR: Ed Skolnik
#MODIFIED: 2003/08/11 Created
# Purpose to properly To properly delete a Legato Networker client
# and to clean up all Legato Networker databases.
# The nsradmin program does not purge the Media or Client file Index's
#
# ###############################################################################
display_message () {
case $1 in
A|a) message_level="ALERT";;
I|i) message_level="INFORMATION";;
W|w) message_level="WARNING";;
*) message_level="";;
esac
if [ -r $tmpmessage -a -w $tmpmessage ]; then
:
else
echo "$(basename $0) Error in calling display_message function "
exit 69
fi
mailx -s&quot;$message_level $(basename $0) $(uname -n) $message_level $(who am i | awk '{print $1}' )&quot; -c $mailto < $tmpmessage
cat $tmpmessage
rm $tmpmessage
}

# ###################################################################
# # M A I N L I N E
# ##################################################################
#
# Declare environment variables here
#
nsrlog=/nsr/logs/daemon.log
mailto='root'
tmpmessage=/tmp/$(basename $0)_message.$$
tmpclients=&quot;/tmp/$(basename $0)_clients.$$&quot;
#
if [ $# -ne 1 ]; then
echo &quot; &quot;
echo &quot;usage: &quot;
echo &quot;$0 clientname &quot;
echo &quot; &quot;
echo &quot;Aborted &quot;
exit 69
fi
touch /tmp/a.$$
root=`ls -l /tmp/a.$$ | awk '{print $3}'`
rm /tmp/a.$$
if [ &quot;$root&quot; = &quot;root&quot; ];then
:
else
echo &quot;In order to run this script you must be root&quot;
exit
fi
client=&quot;${1:-nowayinhell}&quot;
echo &quot;client $client&quot;
nsradmin <<EOF | sed 's/nsradmin>//g' |sed 's/;//g' | sed 's/name://g' | sed 's/ //g' | sort | grep -v ^$ | tail +3 | grep -v chi-backup | tr '[:upper:]' '[:lower:]' > $tmpclients
show name
print type:NSR client
EOF
#
if [ $(grep -c $client $tmpclients) -eq 0 ]; then
echo &quot;Client name $client not found, Purge aborted &quot; > $tmpmessage
cat $tmpclients >> $tmpmessage
display_message W
exit 68
fi

echo &quot;Displaying Media Database to verify &quot;
mminfo -ot -q&quot;client=$client&quot; -r'volume,ssid,client,savetime(17),name' | more
echo &quot; &quot;
echo &quot;Are you sure you want to delete client $client&quot;
echo &quot;and all reference to the backup media ? &quot;
echo &quot;Reply y or n&quot;
read yesorno
if [ $(echo ${yesorno:-n} | tr -s '[:upper:]' '[:lower:]') = 'y' ]; then
:
else
echo &quot;Aborting purge -- No changes Made&quot;
exit 1
fi
echo &quot;$(date +%m/%d/%y) $(date +%H:%M:%S) $(basename $0) Started for client $client &quot; >> $nsrlog
#
echo &quot;Begin purge of the Media database for client $client&quot;
for I in $(mminfo -ot -q&quot;client=$client&quot; -r'volume,ssid,client' | awk {'print $2'} ); do
echo &quot;nsrmm -d -y -S $I &quot;
nsrmm -d -y -S $I
if [ $? -ne 0 ]; then
sleep 5
nsrmm -d -y -S $I
if [ $? -ne 0 ]; then
sleep 5
nsrmm -d -y -S $I
fi
fi
done
#
if [ $(mminfo -ot -q&quot;client=$client&quot; 2>/dev/null | wc -l) -eq 0 ]; then
echo &quot;Begin process of deleting the Client $client from the resource database&quot;
else
echo &quot;$client still has Media database entries &quot; > $tmpmessage
echo &quot;Please restart delete process &quot; >> $tmpmessage
display_message W
exit 67
fi
#
while [ ${nsradminrc:-0} -eq 0 ]; do
echo &quot;Deleting Client Resource $client &quot;
nsradmin -i - <<EOF
delete type:NSR client;name:$client
EOF
nsradminrc=$?
echo $nsradminrc
done
#
echo &quot;Deleting Client file Index for $client &quot;
find /nsr/index/$client -type f -exec rm {} \;
find /nsr/index/$client -type d -depth -exec rmdir {} \;
#
# Clean up temp files
find /tmp -name &quot;$(basename $0)*&quot; -type f -exec rm {} \;
echo &quot;$(date +%m/%d/%y) $(date +%H:%M:%S) $(basename $0) Ended &quot; >> $nsrlog
exit 0



Ed Skolnik
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top