gpload.sh 411 B

123456789101112131415
  1. #!/bin/bash
  2. source /usr/local/greenplum-db-clients/greenplum_loaders_path.sh
  3. table=$1
  4. # 由于gpload需要输入密码,这里需要使用expect执行
  5. password=sqmdb_1QAZ
  6. expect -c "
  7. set timeout 300
  8. spawn gpload -f /data/site_info/gpload/${table}.yml
  9. expect {
  10. \"connecting (yes/no)?\" { send \"yes\n\";exp_continue }
  11. \"Password:\" { send \"${password}\n\"; exp_continue}
  12. timeout { puts \"超时\" exit 2}
  13. }
  14. "