Commit 8488ffd361788f4e4f528adf1796448739749d8c

Authored by evan ago
1 parent d8c6c1a5d0
Exists in master

back

Showing 1 changed file with 3 additions and 3 deletions Inline Diff

#!/bin/bash 1 1 #!/bin/bash
2 2
BASEDIR=$(dirname $0) 3 3 BASEDIR=$(dirname $0)
4 4
if [ $# != '1' ] && [ $# != '2' ]; 5 5 if [ $# != '1' ];
then 6 6 then
echo "usage : sh score.sh <scalaClassName>" 7 7 echo "usage : sh score.sh <scalaClassName>"
echo "ex) sh score.sh EditorScore" 8 8 echo "ex) sh score.sh EditorScore"
exit 9 9 exit
fi 10 10 fi
11 11
HOME=$BASEDIR 12 12 HOME=$BASEDIR
LOG_DIR=$HOME/logs 13 13 LOG_DIR=$HOME/logs
mkdir -p $LOG_DIR 14 14 mkdir -p $LOG_DIR
TODAY=`date +"%Y%m%d"` 15 15 TODAY=`date +"%Y%m%d"`
DATE_SUB="7" 16 16 DATE_SUB="7"
DAY_TO_DELETE="$(date "+%Y%m%d" -d "$DATE_SUB days ago")" 17 17 DAY_TO_DELETE="$(date "+%Y%m%d" -d "$DATE_SUB days ago")"
DELETE_LOG="${LOG_DIR}/$1_$DAY_TO_DELETE.log" 18 18 DELETE_LOG="${LOG_DIR}/$1_$DAY_TO_DELETE.log"
LOG="${LOG_DIR}/$1_$2_$TODAY.log" 19 19 LOG="${LOG_DIR}/$1_$TODAY.log"
20 20
#HADOOP_CONF_DIR=/etc/hadoop/conf 21 21 #HADOOP_CONF_DIR=/etc/hadoop/conf
22 22
/data/spark/bin/spark-submit \ 23 23 /data/spark/bin/spark-submit \
--class $1 \ 24 24 --class $1 \
--master yarn-client \ 25 25 --master yarn-client \
--conf "spark.default.parallelism=250" \ 26 26 --conf "spark.default.parallelism=250" \
$BASEDIR/target/scala-2.11/dsquality-assembly-0.1.0-SNAPSHOT.jar $2 >> $LOG 2>&1 27 27 $BASEDIR/target/scala-2.11/dsquality-assembly-0.1.0-SNAPSHOT.jar >> $LOG 2>&1
#target/scala-2.11/dsmakingscore-assembly-0.1.0-SNAPSHOT.jar >> $LOG 2>&1 28 28 #target/scala-2.11/dsmakingscore-assembly-0.1.0-SNAPSHOT.jar >> $LOG 2>&1
#target/scala-2.11/dsmakingscore_2.11-0.1.0-SNAPSHOT.jar >> $LOG 2>&1 29 29 #target/scala-2.11/dsmakingscore_2.11-0.1.0-SNAPSHOT.jar >> $LOG 2>&1
#--jars "lib_managed/jars/mysql/mysql-connector-java/mysql-connector-java-5.1.36.jar" \ 30 30 #--jars "lib_managed/jars/mysql/mysql-connector-java/mysql-connector-java-5.1.36.jar" \
31 31
32 32
echo "END END END END END" >> $LOG 33 33 echo "END END END END END" >> $LOG
echo "END END END END END" >> $LOG 34 34 echo "END END END END END" >> $LOG
echo "END END END END END" >> $LOG 35 35 echo "END END END END END" >> $LOG
echo "END END END END END" >> $LOG 36 36 echo "END END END END END" >> $LOG
echo "END END END END END" >> $LOG 37 37 echo "END END END END END" >> $LOG
38 38
echo "IF LOG FILE $DELETE_LOG EXISTS DELETE" >> $LOG 39 39 echo "IF LOG FILE $DELETE_LOG EXISTS DELETE" >> $LOG
# Log rotation 40 40 # Log rotation