for date in $date_list do echo "start to hive partition" hive -e "ALTER TABLE hive_table_name ADD PARTITION(dt='$date');" echo "hive partition finished" done
if /hadoop/bin/hdfs dfs -ls hdfs://host1:8020/ | grep logs then echo "host1 status is active" else echo "host2 status is active" namenodeHost="hdfs://host2:8020/" fi