automate backup and restore

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

automate backup and restore

Darshangera
I wrote below in xyz.bat file.

d:
cd D:\Program Files\PostgreSQL\8.0\bin
del z:\newgenlib_plain_bkup.sql /q
pg_dump newgenlib -U postgres -W newgenlib > z:\newgenlib_plain_bkup.sql

Only problem it prompts for a password every time. I went through manual but did not find an option bby which I can avoid this.

For restore Purpose on a different server:
cd D:\Program Files\PostgreSQL\8.0\bin
psql -U postgres -d newgenlib  -f z:\newgenlib_plain_bkup.sql.

I am not to avoid password prompt in backup?
If someone can help in this, it will be great.
With regards,
Darshan
(darshansai@gmail.com)
Reply | Threaded
Open this post in threaded view
|

Re: automate backup and restore

verussolutions
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: automate backup and restore

Darshangera
Dear sir,
Thanks for info. But still I am not able to integrate password information. On doc link, -w option is for no password is mentioned. But when we use pg_dump with -w no, it says -w option not supported.
2nd thing is pgpass.conf file for hostname:port:database:username:password. But this file is not present anywhere.
Can you help me in writing batch file to take automated backup.

Thanks