#!/bin/bash
# 自动生成azkaban job
# ***
# 使用案例:sh crt_load_table_job.sh risk
dbsname=$1
function crt_table_job()
{
dset=`/usr/bin/mysql -u*** -p*** -h*** --default-character-set=utf8 -Dinformation_schema -N -e"
select concat( 'type=command', '&','command= sh /disk4/azkaban/shell/huihuahua/sqoop_mysql_hive_table_huihuahua.sh '
,TABLE_SCHEMA,' ',table_name,' a','&', 'retries=3','&','retry.backoff=120000','#',table_name,'#',TABLE_SCHEMA)
from (
select table_name,TABLE_SCHEMA
from (select table_name,TABLE_SCHEMA from information_schema.tables where table_schema='$dbsname' and table_name='$table_name') t1
)tm;
"`
cfgname=`echo $dset | awk -F'#' '{print $1}'`
cfgtab&
# 自动生成azkaban job
# ***
# 使用案例:sh crt_load_table_job.sh risk
dbsname=$1
function crt_table_job()
{
dset=`/usr/bin/mysql -u*** -p*** -h*** --default-character-set=utf8 -Dinformation_schema -N -e"
select concat( 'type=command', '&','command= sh /disk4/azkaban/shell/huihuahua/sqoop_mysql_hive_table_huihuahua.sh '
,TABLE_SCHEMA,' ',table_name,' a','&', 'retries=3','&','retry.backoff=120000','#',table_name,'#',TABLE_SCHEMA)
from (
select table_name,TABLE_SCHEMA
from (select table_name,TABLE_SCHEMA from information_schema.tables where table_schema='$dbsname' and table_name='$table_name') t1
)tm;
"`
cfgname=`echo $dset | awk -F'#' '{print $1}'`
cfgtab&