#!/bin/ksh # ---------------------------------------------- # author(s) : Edward Corrado, Eric Thul # title : makerss.ksh # date : 2006.09.16 # version : 0.2 # license : The Artistic License # http://www.perl.com/pub/a/language/misc/Artistic.html # # description : This script runs all SQL*Plus queries located in # /export/home/voyager/sql/rss that are designed to # create flat files of new library acquistions, and then # the script calls rss.pl to convert the flat files into # RSS 2.0 files. This script is normally ran via cron. # history : Version 0.2 of this script added the ability to de-dupe # records based on the second field (either BIBID or ISBN) # Set Oracle vars here . /export/home/voyager/.profile ORACLE_SID=LIBR ORAENV_ASK=NO . /usr/local/bin/oraenv USERNAME=foo PASSWORD=bar cd /export/home/voyager/rss for subject in `ls *.sql` do echo "###########################################################" echo "Starting extract of data for $subject" /oracle/app/oracle/product/8.0.5/bin/sqlplus -s $USERNAME/$PASSWORD @/export/home/voyager/rss/${subject} >> $subject.log echo $subject completed echo "###########################################################" done /bin/perl -F'\|' -i.bak -ane 'print unless $seen{$F[1]}++' *.lst /export/home/voyager/rss/rss.pl /export/home/voyager/rss/rss-complete.ini scp /export/home/voyager/rss/*.xml username@webserver.college.edu:www/rss/