gpload.sh 429 B

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