Login  Register

automate backup and restore

Posted by Darshangera on Dec 27, 2010; 5:19am
URL: http://ngl.70.s1.nabble.com/automate-backup-and-restore-tp5868821.html

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)