Dynamic Blinkie Text Generator at TextSpace.net

Feedburner

I heart FeedBurner

Rabu, 18 Oktober 2017

Create Auto Backup Database Postgresql

Cara :
1). Copy Script :
@ECHO OFF
@setlocal enableextensions
@cd /d "%~dp0"

SET PGPATH=C:\"Program Files"\PostgreSQL\9.1\bin\
SET SVPATH=f:\
SET PRJDB=demo
SET DBUSR=postgres
FOR /F "TOKENS=1,2,3 DELIMS=/ " %%i IN ('DATE /T') DO SET d=%%i-%%j-%%k
FOR /F "TOKENS=1,2,3 DELIMS=: " %%i IN ('TIME /T') DO SET t=%%i%%j%%k

SET DBDUMP=%PRJDB%_%d%_%t%.sql
@ECHO OFF
%PGPATH%pg_dump -h localhost -p 5432 -U postgres %PRJDB% > %SVPATH%%DBDUMP%

echo Backup Taken Complete %SVPATH%%DBDUMP%
 
Note :
  • PGPATH - PostgreSQL path
  • SVPATH - Backup File path
  • PRJDB - Name of the Database which will be backup
  • DBUSR - Database user name
 2. Save jadi file.bat dan jalankan 
 
Sumber : https://www.codeproject.com/Tips/458884/Auto-Backup-for-PostgreSQL 
 
Keyword : auto backup for postgreesql professional edition full 

Tidak ada komentar:

Posting Komentar