rtdmp_deal_success.sh 431 Bytes
Newer Older
wang-jinfeng committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#!/bin/bash

source ../dmp_env.sh

today=${ScheduleTime}

date_time=$(date +"%Y-%m-%d %H" -d "-1 hour $today")

date_path=$(date +%Y/%m/%d/%H -d "-1 hour $today")

INPUT="s3://mob-emr-test/dataplatform/rtdmp_deal/${date_path}/"

if hadoop fs -ls ${INPUT} >/dev/null 2>&1; then
  hadoop fs -touchz ${INPUT}/_SUCCESS
else
  hadoop fs -mkdir -p ${INPUT}
  hadoop fs -touchz ${INPUT}/_SUCCESS
fi

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