datax分页批量同步数据
程序员文章站
2022-07-13 08:58:30
...
[[email protected] job]# cat test.sh
#!/bin/bash
v_table=‘aa’
let v_split_num=300000
let v_start_num=0
let v_end_num=0
v_table_list=’/opt/datax/job/table_name.txt’
v_table_name=’’
v_exec_command=’/opt/datax/bin/datax.py’
v_path_json=’/opt/datax/job/mysqltest.json’
for table_name in cat $v_table_list
do
v_table_name=echo $table_name|awk -F ":" '{print $1}'
let v_total_num=echo $table_name|awk -F ":" '{print $2}'
v_pages=((v_split_num))+1))
for ((i=1;i<=((i-1))*((v_split_num))
$v_exec_command -p "-Dtable_name=${v_table_name} -Dstart_rowid=${v_start_num} -Dend_rowid=${v_end_num}" $v_path_json
# echo $v_table_name,$v_start_num,$v_end_num
done
done
上一篇: Hibernate缓存的使用
下一篇: rabbitmq批量处理