Permalink
Browse files

adding shell scripts

  • Loading branch information...
1 parent 6cdab76 commit 83f1e7e4b5513309999679b1f399237a5c53d6e4 Jared Williams committed Sep 15, 2011
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+apppath='/usr/local/tomcat/webapps/legislation/WEB-INF'
+
+java -Xmx756m -Xms16m -cp $apppath/classes/:$apppath/lib/* $@
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+CLASS=gov.nysenate.openleg.ingest.Ingest
+
+CWD=`dirname $0`
+cd ..
+SOBI_DIR=`pwd`/data
+cd $CWD
+
+JSON_DIR=/usr/local/openleg/json/
+
+function default {
+ $CWD/base.sh $CLASS -jd $JSON_DIR -sd $SOBI_DIR $@
+}
+
+function custom {
+ local sd=$1
+ shift
+ echo $sd
+ $CWD/base.sh $CLASS -jd $JSON_DIR -sd $sd $@
+}
+
+COMMAND=$1
+
+case $COMMAND in
+ -d | --default ) shift
+ default $@
+ ;;
+ -c | --custom ) shift
+ custom $@
+ ;;
+ * ) default $@
+ ;;
+esac
+
+
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+`dirname $0`/base.sh gov.nysenate.openleg.qa.ReportReader $@
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+`dirname $0`/base.sh gov.nysenate.openleg.search.SearchEngine $@
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+function usage
+{
+ echo "usage: $0 (-(r|i|h)|--(report|ingest|help)) (--help|<params>)"
+}
+
+CWD=`pwd`
+
+BASE=`pwd`
+BIN=$BASE/bin
+
+COMMAND=$1
+shift
+
+case $COMMAND in
+ -r | --report ) $BIN/report.sh $@
+ ;;
+ -i | --ingest ) $BIN/ingest.sh $@
+ ;;
+ -s | --search ) $BIN/search.sh $@
+ ;;
+ -h | --help ) usage
+ ;;
+ * ) usage
+ exit 1
+esac
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+cd /home/ubuntu/openleg
+
+BASE_DIR=`pwd`
+WORK_DIR=$BASE_DIR/work
+DATA_DIR=$BASE_DIR/data
+LOG_DIR=$BASE_DIR/logs
+DEST_DIR=$BASE_DIR/processed/
+DATE=`date +%Y%m%d%H%M`
+
+DATA_COUNT=`ls $DATA_DIR | wc -l`
+
+if [ $DATA_COUNT -eq 0 ] ; then
+ exit 0
+fi
+
+if [ $# -gt 0 ] ; then
+ DATA_DIR=$1
+fi
+
+if [ $# -gt 1 ] ; then
+ DEST_DIR=$2
+fi
+
+exec 1> $LOG_DIR/process-$DATE.out
+exec 2> $LOG_DIR/process-$DATE.err
+
+cd $BASE_DIR
+mv $DATA_DIR/* $WORK_DIR/
+
+#pull cal/agenda xml from sobis
+./openleg.sh -i -c $WORK_DIR -gx
+
+mv $WORK_DIR/*age* $WORK_DIR/age/
+mv $WORK_DIR/*cal* $WORK_DIR/cal/
+mv $WORK_DIR/*.TXT $WORK_DIR/sobi/
+rm $WORK_DIR/*ann*
+
+#write json from sobis/xml
+./openleg.sh -i -c $WORK_DIR/sobi -w
+./openleg.sh -i -c $WORK_DIR/age -w
+./openleg.sh -i -c $WORK_DIR/cal -w
+
+./openleg.sh --ingest -i -pc
+
+mv $WORK_DIR/sobi/* $DEST_DIR/sobi/
+mv $WORK_DIR/age/* $DEST_DIR/age/
+mv $WORK_DIR/cal/* $DEST_DIR/cal/

0 comments on commit 83f1e7e

Please sign in to comment.