]> git.evergreen-ils.org Git - Evergreen.git/blob - Evergreen/src/support-scripts/eg_gen_overdue.sh
preventing runs on sat and sun
[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 DATE=$(date +%Y-%d-%m);
10 DAY=$(date +%u);
11 BSCONFIG="/openils/conf/bootstrap.conf"
12
13 [ $(whoami) != "opensrf" ] && echo "Must be run as opensrf" && exit 1;
14 source /etc/profile;
15 ARGS="0"
16
17 [ $DAY == 6 -o $DAY == 7 ] && exit 0; # don't run on saturday or sunday
18 if [ $DAY == 1 ]; then ARGS="2 1 0"; fi; # If today is monday, run for sat/sun/mon
19
20 ./eg_gen_overdue.pl $BSCONFIG $ARGS > "/openils/var/web/tmp/overdue/EG_overdue.$DATE.xml"
21
22