Step 1: Open your IDE (Notepad,Notepad++, Sublime Text)
Backup Code:
@echo off
echo hello backup
REM -h == host, -p == port -u == user
SET PGPATH="E:\PostgreSQL\9.5\bin\pg_dump.exe"
%PGPATH% -h localhost -p 5432 -U postgres -F t qkbase_db_local > C:\Users\Pukar\Downloads\backupfile\20170331.backup
set /p DUMMY=Press ENTER KEY to EXIT
Step 2: Save File name "batch_file_backup.bat"
Screenshot
Restore Code:
@echo off
echo hello re-store
REM -h == host, -p == port -u == user
SET PGPATH="E:\PostgreSQL\9.5\bin\psql.exe"
%PGPATH% -h localhost -p 5432 -f C:\Users\Pukar\Downloads\backupfile\qkbakup.sql qkbase_db_localv01 postgres
set /p DUMMY=Press ENTER KEY to EXIT
Screenshot
0 comments:
Post a Comment