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