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

Automate daily eject of full volumes from jukebox

Status
Not open for further replies.

powtek

MIS
Aug 22, 2009
4
US
Hi,
Im new to Networker and EMC does not provide scripts.
What is the best way to automate the jukebox ejection of all full volumes on a daily basis? Should I create scripts and hand it over to Networker? And how do I combine the steps for Networker to accomplish this without any operator intervention? (except for when to empty the cap).
Thanks.
Andy
 
Unfortunately you must define a script which you then activate independently or as part of a post-backup command.

You can find examples how to handle pre-/post-BU scripts in the Admin Guide.
 
#!/usr/bin/sh
#
# Script: eject_tapes.sh
#
# Purpose: This script generates a daily report of cloned volumes in NetWorker
# to be sent offsite and of volumes that can be returned to the library
# from offsite.
#
#
#
FOOTER1="***Report run on system nsrha by user lgtoadm."
FOOTER2="***/nsr/scripts/eject_tapes.sh"
OUTFILE=eject_tapes.txt
TMPFILE=eject_tapes.tmp
LIBRARY="sl8500"
MAILTO="user name"
#
# Begin main
#
#
# Remove the temp file if it exists.
#
#[ -s $TMPFILE ] && rm $TMPFILE
#
# Eject any volumes not in use.
#
sudo nsrjb -j $LIBRARY -u
#
# Print header to file.
#
echo "Daily tapes to be sent offsite:" > $OUTFILE
echo "-------------------------------" >> $OUTFILE
#
# Create a list of clone pools.
#
sudo mminfo -r "pool" -q "clonetime > yesterday,location=$LIBRARY"|sort|uniq|grep -v Test|while read POOL
do
#
# For each clone pool, list any volumes to be sent offsite to a temp file.
#
sudo mminfo -r "volume" -q "clonetime > yesterday,%used>100,pool=$POOL,location=$LIBRARY, written > 0, near, !volrecycle, !inuse" >> $TMPFILE
done
#
# Process the list of volumes in the temp file to be sent offsite.
#
cat $TMPFILE|while read VOLUME
do
#
# Set the location of the volume.
#
sudo mmlocate -n $VOLUME -u "Offsite"
#
# Print the information of volumes to be sent offsite to the report.
#
sudo mminfo -r "volume,pool,location" -q "volume=$VOLUME"|grep -v volume >> $OUTFILE
#
# Set the volume as ReadOnly in case the volume is returned to the library before it is reusable.
#
sudo nsrmm -o readonly -y $VOLUME
#
# Eject the volume from the NetWorker database (ACSLS procedure).
#
sudo mmlocate -n $VOLUME -u "Offsite"
echo "Volume set Offsite" $VOLUME
sudo nsrjb -j $LIBRARY -x -T $VOLUME
done
#
# Print volume return header to report.
#
echo >> $OUTFILE
echo "Daily tapes to be Returned:" >> $OUTFILE
echo "---------------------------" >> $OUTFILE
#
# Print the list of volumes that are recyclable and can be returned from offsite.
#
sudo mminfo -r "volume,pool,location" -q "!near, volrecycle, !manual"|grep -v volume >> $OUTFILE
#
# Eject the volumes to be sent offsite from the STK silo to the cap (ACSLS procedure).
#
sudo stk_eject acsls01 0,1,0 nowait `cat $TMPFILE`
#
# Print the bootstrap information to the report to be sent offsite with the volumes.
#
#echo >> $OUTFILE
#echo "Bootstrap report to be kept offsite:" >> $OUTFILE
#echo "------------------------------------" >> $OUTFILE
#sudo mminfo -B >> $OUTFILE
#
# Print footer information to the report.
#
echo >> $OUTFILE
echo >> $OUTFILE
echo "$FOOTER1" >> $OUTFILE
echo "$FOOTER2" >> $OUTFILE
#
# Email the report.
#
mailx -s "NetWorker tapes to be sent offsite/returned" $MAILTO < $OUTFILE
#
# End main
$
We use this unix script which you can use a guide, we also have a sl8500, that is why we use the stk_eject command you can use the nsrjb -X command insted if you have a different silo. good luck
 
thank you so much for this step by step script.. it is very useful in what i want to accomplish.. thanks again.
 
I have another question regarding the automation of daily offsite cartridges. I have written the scripts and it works fine. The only problem I encounter now is this:
I only have 6 slots in the cap. Anything more than 6 tapes will make the nsrjb -w command to fail. Does anybody have a similar problem? If so, what solution or ideas did anyone come up with? thank you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top