Michael Doran Home Page
Contact | Site Map | Search  
  Home > Archives > Using Scripts > Reading & Writing > Example #1: patron-update 2
Using Scripts to Automate Voyager Tasks

Example #1: patron-update 1 2 3 4 5 6

#!/bin/ksh

###################################################
#
#  Shell script: patron-update
#
#  1999, Michael Doran, doran@uta.edu
#  University of Texas at Arlington Libraries 
#
#  Runs the Voyager Patron Update program (see
#  Voyager Technical Manual, page 65) which
#  takes a patron file generated and FTP'd over
#  by AIS and updates the Voyager patron database. 
#
#  Saves one week's worth of patron SIF, audit,
#  and error files.
#
#  Runs via the "voyager" crontab.
#
###################################################

# Clear out this day's audit and error files
# otherwise, Pptrnupdt will append to old
/usr/bin/echo "" > /m1/voyager/xxxdb/rpt/patron.aud.`date +%a`
/usr/bin/echo "" > /m1/voyager/xxxdb/rpt/patron.err.`date +%a`

/m1/voyager/xxxdb/sbin/Pptrnupdt \
    -p /export/home/aisftp/LBJ00024.D01 \
    -m 2000 \
    -e /m1/voyager/xxxdb/rpt/patron.err.`date +%a` \
    -a /m1/voyager/xxxdb/rpt/patron.aud.`date +%a` \
    -o I
/usr/bin/mv /export/home/aisftp/LBJ00024.D01 \
            /export/home/aisftp/ptrn-updt.`date +%a`

# and exit script
exit 0