Commit 1f2e4db3 1f2e4db348a50ff5afd97b989dcc4319c7f5998a by zhanghao

commit

1 parent 0f358da6
1 #!/bin/bash 1 #!/bin/bash
2 #mvn clean package -DskipTests
3 #hadoop fs -rm /input/data/$1
4 #hadoop fs -put ../$1 /input/data/$1
5 #hadoop jar ./target/BrBigDataTest-1.0.0.jar com.bigdata.test.ETLApp /input/data/$1 /input/etl/
6 #sleep 3
7 #hive -f ./shell/load_data.hql
8 #total=$(hive -f ./shell/select.hql)
9 #result=$(echo $total | tr " " ",")
10 #curl http://192.168.8.113:9090/tool/hadoopTotal?total=${result}
11 $(hive -hivevar name=$2 -f ./shell/back_up.hql)
...\ No newline at end of file ...\ No newline at end of file
2 time=log-$(date -v-1H +%Y-%m-%d.%H).log
3 backupname=qa_log_$(date -v-1H +%Y_%m_%d_%H)
4
5 scp -P 61702 -r test@123.56.14.255:/home/data/logs/logstash/litetuo/asst-gateway/$time ../
6
7 mvn clean package -DskipTests
8
9 hadoop fs -rm /input/data/$time
10 hadoop fs -put ../$time /input/data/$time
11 hadoop jar ./target/BrBigDataTest-1.0.0.jar com.bigdata.test.ETLApp /input/data/$time /input/etl/
12 sleep 3
13
14 hive -f ./shell/load_data.hql
15
16 total=$(hive -f ./shell/select.hql)
17 result=$(echo $total | tr " " ",")
18 curl http://192.168.8.113:9090/tool/hadoopTotal?total=${result}
19
20 $(hive -hivevar name=$backupname -f ./shell/back_up.hql)
21 hadoop fs -rm /input/data/$time
22 rm ../$time
...\ No newline at end of file ...\ No newline at end of file
......
1 use testdb; 1 use testdb;
2 create table ${hivevar:name} as select * from qa_log
...\ No newline at end of file ...\ No newline at end of file
2 drop table ${hivevar:name};
3 create table ${hivevar:name} as select * from qa_log;
...\ No newline at end of file ...\ No newline at end of file
......