Shell 脚本命令是: hadoop fs -ls/user/hive/warehouse/mashery_db.db/agg_per_mapi_stats_five_minutes/|排序 | awk '{ if (index($8, ".hive") == 0 && $6 <= "'"delete_up_to_epoch_date"'"&& $7 <= "'"delete_up_to_epoch_hour:00"'") 打印 $8 }' + str(date_from).zfill(2) + '*'
基本上我想在 python 脚本中执行。
请您参考如下方法:
基本上你可以打开一个管道来执行你的命令。
import os
p = os.popen("YOUR_COMMAND")
