]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/src/support-scripts/eg_gen_overdue.sh
basically done, could use some more testing
[Evergreen.git] / Evergreen / src / support-scripts / eg_gen_overdue.sh
1 #!/bin/bash
2 # ---------------------------------------------------------------
3 # This file runs the overdue generation script.
4 # If today is Monday, it runs the script for Sat/Sun/Mon, 
5 # otherwise it runs once per day.
6 # ---------------------------------------------------------------
7
8
9
10
11 DATE=$(date +%Y-%m-%d);
12 DAY=$(date +%u);
13 BSCONFIG="/openils/conf/bootstrap.conf"
14 ODDIR="/openils/var/data/overdue";
15 #ODDIR="/tmp";
16
17 export EG_OVERDUE_EMAIL_TEMPLATE="../extras/overdue_notice_email";
18 export EG_OVERDUE_SMTP_HOST="apollo.georgialibraries.org";
19 export EG_OVERDUE_EMAIL_SENDER="evergreen@georgialibraries.org";
20
21 [ $(whoami) != "opensrf" ] && echo "Must be run as opensrf" && exit 1;
22 source /etc/profile;
23 ARGS="0"
24
25 [ $DAY == 6 -o $DAY == 7 ] && exit 0; # don't run on saturday or sunday
26 if [ $DAY == 1 ]; then ARGS="2 1 0"; fi; # If today is monday, run for sat/sun/mon
27
28 echo "RUNNING";
29 ./eg_gen_overdue.pl $BSCONFIG $ARGS > "$ODDIR/overdue.$DATE.xml"
30