Обсуждение: Restore & Backup using Batch file

Поиск
Список
Период
Сортировка

Restore & Backup using Batch file

От
parthdesai
Дата:
Hello,

I want to restore my .BACKUP file and create .BACKUP file using command
line.As i have created backup from my client PC and wanted to restore that
using Batch file.Please suggest me how can i achieve this if possible send
me the example batch file for it.
Below is the command i am using for CREATING backup but resulting into error
after executing

"C:\Program Files\PostgreSQL\9.3\bin\pg_dump.exe" --host 127.0.0.1
--port 5432 --username "postgres" --password "Maestro" --verbose -F p 
--file "D:\EMS1.backup" "GROVEL" 
pause

<http://postgresql.nabble.com/file/n5834848/CMD.png> 




--
View this message in context: http://postgresql.nabble.com/Restore-Backup-using-Batch-file-tp5834848.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.



Re: Restore & Backup using Batch file

От
parthdesai
Дата:
"C:\Program Files\PostgreSQL\9.3\bin\pg_dump.exe" -i -h localhost -p 5432 -U
postgres -F c -b -v -f "D:\GROVEL.backup" GROVEL
pause
-----Restore

"C:\Program Files\PostgreSQL\9.3\bin\pg_restore.exe"-i -h localhost -p 5432
-U postgres -d Test1 -W -v "D:\GROVEL.backup"
pause



--
View this message in context: http://postgresql.nabble.com/Restore-Backup-using-Batch-file-tp5834848p5834860.html
Sent from the PostgreSQL - pgadmin support mailing list archive at Nabble.com.



Re: Restore & Backup using Batch file

От
Raymond O'Donnell
Дата:
On 21/01/2015 06:52, parthdesai wrote:
> Hello,
> 
> I want to restore my .BACKUP file and create .BACKUP file using
> command line.As i have created backup from my client PC and wanted to
> restore that using Batch file.Please suggest me how can i achieve
> this if possible send me the example batch file for it. Below is the
> command i am using for CREATING backup but resulting into error after
> executing
> 
> "C:\Program Files\PostgreSQL\9.3\bin\pg_dump.exe" --host 127.0.0.1 
> --port 5432 --username "postgres" --password "Maestro" --verbose -F p
>  --file "D:\EMS1.backup" "GROVEL" pause

This question isn't relevant to pgAdmin; you'd do better to post to
pgsql-general instead.

Having said that, there's no --password option to pg_dump. You need to
use a .pgpass file instead:
 http://www.postgresql.org/docs/9.4/static/libpq-pgpass.html

Ray.



-- 
Raymond O'Donnell :: Galway :: Ireland
rod@iol.ie