summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2014-02-18 21:55:52 +0000
committerNathan Kinkade <nath@nkinka.de>2014-02-18 21:55:52 +0000
commitd63c1c49685387948493ddf800fde533e6c7294c (patch)
tree30fbd8da09629ba433ed2265a3c2ae32dc368770
parent551c7579b5d818abd5c7452bae1a5077e5fae3d6 (diff)
Set the daily run script to send a mail after it has run linking to all the cases it pulled down.
-rw-r--r--daily_run.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/daily_run.sh b/daily_run.sh
index b8509fc..f61bffa 100644
--- a/daily_run.sh
+++ b/daily_run.sh
@@ -1,5 +1,6 @@
#!/bin/bash
+DATE=$(date +'%A, %B %d, %Y')
YEAR=$(date +'%y')
PASSWD=$(cat ../mysql_passwd)
QUERY="SELECT court_case_no FROM cases WHERE court_case_no LIKE 'f-$YEAR-%' ORDER BY id DESC LIMIT 1"
@@ -8,3 +9,13 @@ CASE_ID=${CASE_NO:5}
START=$(echo $CASE_ID | sed 's/^0*//')
./miami_dade_clerk_courts.py $START $YEAR
+
+# Now get the new highest court_case_no
+NEW_CASE_NO=$(mysql -u root -p$PASSWD -ss -e "$QUERY" mdcc)
+
+RCPT_TO="nath@nkinka.de"
+MAIL_FROM="MDCC Script <nath@nkinka.de>"
+SUBJECT="MDCC daily run for $DATE"
+BODY="http://li554-21.members.linode.com/search.php?between=$CASE_NO:$NEW_CASE_NO"
+
+mail -s $SUBJECT -f $FROM $RCPT_TO < $BODY