后台执行CQL脚本

 

Here’s the table of contents:

  1. 执行单条CQL
  2. test.sh批量执行脚本

执行单条CQL

cat /ongdb_data/ongdb-enterprise-3.5.22/test.cql | nohup /ongdb_data/ongdb-enterprise-3.5.22/bin/cypher-shell -a bolt://10.20.7.181:7687 -u ongdb -p testlab%pro >>console.log 2>&1 &

test.sh批量执行脚本

#!/bin/bash
# 定义CQL文件名称
array=(test1 test2 test3 test4 test5 test6)
# 循环后台执行
for cqlFile in ${array[@]}; do
    cat /ongdb_data/ongdb-enterprise-3.5.22/181/${cqlFile}.cql | nohup /ongdb_data/ongdb-enterprise-3.5.22/bin/cypher-shell -a bolt://10.20.7.181:7687 -u ongdb -p testlab%pro >>console.log 2>&1 &
done