These are two scripts that I use for this same purpose.
#!/bin/sh
# Prepare pickup and return lists for DataBank and send them via email.
# Should run on Sunday before noon.
PICKUP=/usr/local/TAUSRC/Local/DataBank/pickuplist.`date +%Y%j`
mminfo -q 'pool=DataBank,%used>0,location=NEO8000,!volrecycle' -r
volume>$PICKUP
SIZE=`wc -l $PICKUP | awk '{print $1}'`
( echo
echo
echo " Please pickup the following $SIZE tapes"
echo
cat $PICKUP
echo
if [ `mminfo -q 'pool=DataBank,volrecycle,location=DataBank' -r volume |
wc -l`
-gt 0 ]
then
echo ' Please return the following tapes'
echo
mminfo -ot -q 'pool=DataBank,volrecycle,location=DataBank' -r volume
| head -$
SIZE
else
echo 'There are no tapes to return.'
fi
echo
echo Thanks.
)| /usr/ucb/Mail -s 'Tel-Aviv University pickup/return list'
yaron AT aristo.tau DOT ac
.il,info AT databank.co DOT il
#!/bin/sh
# Ejects the tapes mentioned in the pickup list to the magazine
# Should run on Monday morning.
#PICKUP=/usr/local/TAUSRC/Local/DataBank/pickuplist.`date +%Y%j`
cd /usr/local/TAUSRC/Local/DataBank
# Eject the tapes from the drives.
cat pickuplist.* | awk '{print "nsrjb -u " $1}' | sh
# Eject the tapes to the magazine.
cat pickuplist.* | awk '{print "nsrjb -w " $1}' | sh
# Set the location field.
cat pickuplist.* | awk '{print "mmlocate -u -n " $1 " DataBank"}' | sh
mv pickuplist.* OldPickupLists
surya wrote:
Hi All,
I am looking to make a manual thing to a automatic thru script..
We have a client for which we backup data to EDL and clone it to tape library
and we send them to offsite on a daily basis even if the tape is not full. It
is ok to send tapes offsite today, that are cloned yesterday.
I am trying to make a script for this, but i am not a expert in scripts..
Can some one help me in this..
Thanks in advance..
Surya....
+----------------------------------------------------------------------
|This was sent by suresh0886 AT yahoo.co DOT in via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------
To sign off this list, send email to listserv AT listserv.temple DOT edu and type
"signoff networker" in the body of the email. Please write to networker-request
AT listserv.temple DOT edu if you have any problems with this list. You can access the
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
--
-- Yaron.
To sign off this list, send email to listserv AT listserv.temple DOT edu and type
"signoff networker" in the body of the email. Please write to networker-request
AT listserv.temple DOT edu if you have any problems with this list. You can access the
archives at http://listserv.temple.edu/archives/networker.html or
via RSS at http://listserv.temple.edu/cgi-bin/wa?RSS&L=NETWORKER
|