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