uc_imei_lahuo_request.sh 1.14 KB
Newer Older
wang-jinfeng committed
1 2 3 4 5
#!/usr/bin/env bash

source ../../dmp_env.sh

LOG_TIME=$(date -d "$ScheduleTime" +"%Y-%m-%d")
wang-jinfeng committed
6 7 8 9 10 11 12 13 14 15 16

if [[ ! -d "/home/hadoop/wangjf" ]]; then
  mkdir /home/hadoop/wangjf

  cd /home/hadoop/wangjf/

  hdfs dfs -get s3://mob-emr-test/wangjf/data/pem/dataplatform_cn.pem .

  chmod 600 dataplatform_cn.pem
fi

wang-jinfeng committed
17 18 19 20
fors=400

concurrent=10000

wang-jinfeng committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
device_type="IMEI_MD5"

shell=" -cp /root/workspace/DMP-1.0.3-jar-with-dependencies.jar mobvista.dmp.datasource.ali.UCRequest ${fors} ${concurrent} ${LOG_TIME} ${device_type}"

ssh -o "StrictHostKeyChecking no" -i /home/hadoop/wangjf/dataplatform_cn.pem -l root 182.92.177.185 "sh -x /root/workspace/check_process.sh '${shell}'"

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

ssh -o "StrictHostKeyChecking no" -i /home/hadoop/wangjf/dataplatform_cn.pem -l root 182.92.177.185 "/root/workspace/exec_uc.sh ${fors} ${concurrent} ${LOG_TIME} ${device_type} >/root/workspace/exec_uc_imei.log &"

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

wang-jinfeng committed
37
sleep $((fors * 60))
wang-jinfeng committed
38 39 40 41 42 43

ssh -o "StrictHostKeyChecking no" -i /home/hadoop/wangjf/dataplatform_cn.pem -l root 182.92.177.185 "sh -x /root/workspace/check_process.sh '${shell}'"

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