mysql 连接jar包请自己更换
#!/bin/bash
JAVA_HOME=/data/java/jdk1.8.0_77
export PATH=$PATH:$JAVA_HOME/bin
sdatatime=$(date -d "-1 minute" "+%Y-%m-%d %H:%M:%S")
edatatime=$(date "+%Y-%m-%d %H:%M:%S")
w="\"where\":\"createtime >= \\\"${sdatatime}\\\" and createtime < \\\"${edatatime}\\\"\""
str='{
"job": {
"content": [
{
"reader": {
"name": "mysqlreader",
"parameter": {
"column": [
"aaa",
"bbb"
],
'${w}',
"connection": [
{
"jdbcUrl": ["jdbc:mysql://127.0.0.1:3306/aaa?characterEncoding=UTF-8&serverTimezone=GMT%2B8"],
"table": ["aaa"]
}
],
"password": "aaa",
"username": "aaa"
}
},
"writer": {
"name": "mysqlwriter",
"parameter": {
"column": [
"flag",
"personid",
"carext4"
],
"connection": [
{
"jdbcUrl": "jdbc:mysql://11.11.11.11:3306/aaa?characterEncoding=UTF-8&serverTimezone=GMT%2B8",
"table": ["aaa"]
}
],
"password": "aaa",
"username": "aaa"
}
}
}
],
"setting": {
"speed": {
"channel": "1"
}
}
}
}'
echo $str > /temp/person.json
python /temp/datax.py /temp/person.json
```:
网友评论