CDH上的Shell脚本————用于脚本调度做准备的

#!/bin/bash
set -o errexit

bindir=$(cd $(dirname 0 ) ; p w d ) e c h o " b i n d i r = 0);pwd) echo "bindir= 0);pwd)echo"bindir=bindir"

day=date -d -1hour +%Y-%m-%d
hour=date -d -1hour +%H

if [ $# -eq 2 ];then
echo “hello~~~~~”
day=$1
hour=$2
fi

echo "day:" d a y e c h o " h o u r : " day echo "hour:" dayecho"hour:"hour

echo “====rm local jar”
rm -rf $bindir/*.jar

res=$?
if [ $res -ne 0 ];then
exit $?
fi

#rm -rf spark-etl.jar
echo “===down jars file: /footstone/hbase/wifi/jars”
hadoop fs -get /footstone/hbase/wifi/jars/test-project-1.0-SNAPSHOT.jar b i n d i r / r e s = bindir/ res= bindir/res=?
if [ $res -ne 0 ];then
exit $res
fi

/opt/cloudera/parcels/CDH-6.0.1-1.cdh6.0.1.p0.590678/bin/spark-submit
–class bigdata.Work
–master yarn
–deploy-mode client
–driver-class-path “/etc/hbase/conf.cloudera.hbase/hbase-site.xml”
–executor-memory 512m
–total-executor-cores 1
–conf spark.yarn.executor.memoryOverhead=500
–conf “spark.ui.enabled=true”
$bindir/test-project-1.0-SNAPSHOT.jar
$day $hour

res=$?
if [ $res -ne 0 ];then
exit $res
fi

你可能感兴趣的:(Shell脚本)