#!/usr/bin/expect
set timeout 30
set user USERNAME
set pass PASSWORD
spawn sudo pg_dump npi -U admin -p PORT -h IP -f /home/pgsql_bak/
expect {
"Password" {send "$pass
"}
}
expect eof
#!/usr/bin/expect
set timeout 30
set user USERNAME
set pass PASSWORD
spawn sudo pg_dump npi -U admin -p PORT -h IP -f /home/pgsql_bak/
expect {
"Password" {send "$pass
"}
}
expect eof