def execute(date, file_name):
print("execute %s" %file_name)
cmd = "db2 -tvf /etl/etldata/script/yatop_update/"+date+"/"+file_name
print(cmd)
status, output = subprocess.getstatusoutput(cmd)
if status:
print("\033[1;31;40m execute %s error, cat %s.error to see detail \033[0m" % (file_name, file_name))
with open(file_name+'.error', 'w') as f:
f.write(output)
return -1
return 0
评论列表
文章目录