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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimizing Legato Networker Disk Space Usage

Status
Not open for further replies.

Michael42

Programmer
Oct 8, 2001
1,454
US
Hello,

I could use some suggestions of how to optimize Legato Networker on UNIX (Sun) so as to take up less disk space.

For instance, I noticed if I delete a client using the GUI the indexes and other references still remain. I have a lot of ancient clients that I would like to purge all references to.

Thanks,

Michael42
 
Once you deleted the client, NW is not aware of it any more.
You may now delete the /nsr/index/client_name directory.
 
>> You may now delete the /nsr/index/client_name directory.

Thanks, this is very useful! :)

Thanks,

Michael42
 
FYI, If you delete the client without deleting the savesets from the media database the save sets will never expire.


ID: legato2642
Domain: primus_owner
Solution Class: solution

Goal
-------
How to delete database entries for deleted clients

Goal
-------
Why does NetWorker show media entries for clients that no longer exist?

Fact
-------
NetWorker

Fact
-------
Client has been deleted from Networker

Cause
-------
Clients were deleted from NetWorker before all of their save sets had expired. Consequently, NetWorker did not enforce browse or retention policies on those save sets, and then will never become eligible for recycling.

___________________________________


#!/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 mlovreta@interpublic.com' 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 -s '[: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
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
 
eskolnik,

Thanks - this is very useful!

Michael42
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top