趴网上找了半天没找到备份hbase表结构的操做,只好本身动手,用shell写一句shell
echo -e "list\nexit" | hbase shell \ | awk '/TABLE/,/ row/' | grep -vE "TABLE| row\(s\)" \ | while read TABLE;do echo -e "describe '${TABLE}'\nexit" | hbase shell | tee -a hbase_tbl_dsc`date +%Y%m%d%`.txt;done
执行结果:
在当前目录下生成文件 hbase_tbl_dsc`date +%Y%m%d%`.txtbash