sg481n | bd890c5 | 2017-08-28 12:11:35 -0400 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | JAVA_HOME=_JAVA_HOME_ |
| 3 | PATH=${PATH}:${JAVA_HOME}/bin |
| 4 | ROOT_DIR=_ROOT_DIR_ |
| 5 | ENV_CONTEXT=_ENV_CONTEXT_ |
| 6 | |
| 7 | cd $ROOT_DIR |
| 8 | |
| 9 | if [ ! -e "$ROOT_DIR/data/stage" ]; then |
| 10 | mkdir -p $ROOT_DIR/data/stage |
| 11 | fi |
| 12 | |
| 13 | if [ ! -e "$ROOT_DIR/data/$ENV_CONTEXT/stage" ]; then |
| 14 | mkdir -p $ROOT_DIR/data/$ENV_CONTEXT |
| 15 | ln -s $ROOT_DIR/data/stage $ROOT_DIR/data/$ENV_CONTEXT/stage |
| 16 | fi |
| 17 | |
| 18 | CP=${ROOT_DIR}/etc |
| 19 | for FILE in `ls $ROOT_DIR/lib/*.jar`; do |
| 20 | CP=$CP:$FILE |
| 21 | done |
| 22 | |
| 23 | CMD="V2DataFile all" |
| 24 | echo $CMD >> $ROOT_DIR/cronlog |
| 25 | date >> $ROOT_DIR/cronlog |
| 26 | $JAVA_HOME/bin/java -Xmx2048m -classpath $CP com.att.authz.Batch $CMD >> $ROOT_DIR/cronlog |
| 27 | date >> $ROOT_DIR/cronlog |
| 28 | |
| 29 | cd $ROOT_DIR/data/stage |
| 30 | LATEST=`ls -tr v2*.dat | tail -1` |
| 31 | if [ "$LATEST" != "" ]; then |
| 32 | > ../v2.lock |
| 33 | cp -p $LATEST ../v2.dat |
| 34 | rm ../v2.lock |
| 35 | fi |
| 36 | |
| 37 | LATEST=`ls -tr v2*.skip | tail -1` |
| 38 | if [ "$LATEST" != "" ]; then |
| 39 | cp -p $LATEST ../v2.skip |
| 40 | fi |
| 41 | |
| 42 | for FILE in `ls v2* | grep -v .gz`; do |
| 43 | gzip $FILE |
| 44 | done |
| 45 | |
| 46 | |