1. #!/bin/bash
    2. lis=`cat $1`
    3. cmd=$2
    4. logsout="logs/202206"
    5. if [[ ! -d $logsout ]];then
    6. (mkdir $logsout)
    7. fi
    8. for i in ${lis[@]};do
    9. if [ "$cmd" = "mrCount" ];then
    10. echo "nohup sudo -u hbase hbase org.apache.hadoop.hbase.mapreduce.RowCounter $i >> ${logsout}/${i}.log 2>&1 &"
    11. fi
    12. if [ "$cmd" = "delete_snapshot" ];then
    13. echo "delete_snapshot '${i}_snapshot'"
    14. fi
    15. if [ "$cmd" = "disable" ];then
    16. echo "disable '${i}'"
    17. fi
    18. if [ "$cmd" = "enable" ];then
    19. echo "enable '${i}'"
    20. fi
    21. if [ "$cmd" = "snapshot" ];then
    22. echo "snapshot '${i}','${i}_snapshot'"
    23. fi
    24. if [ "$cmd" = "clone_snapshot" ];then
    25. pre=$3
    26. echo "clone_snapshot '${i}_snapshot','${i}_${pre}'"
    27. fi
    28. if [ "$cmd" = "drop" ];then
    29. echo "drop '${i}'"
    30. fi
    31. done