@ECHO OFF
@setlocal enableextensions
@cd /d "%~dp0"

SET PGPATH=C:\"Program Files"\PostgreSQL\15\bin\pg_dump.exe
SET SVPATH=D:\seaCloud\backup\db\
SET PRJDB=scenedb
SET DBUSR=seacloud
SET DBROLE=seacloud
SET PGPASSWORD=sea+Cloud@123
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%.dump
@ECHO OFF
%PGPATH% -h localhost -p 5432 -U %DBUSR% --role %DBROLE% -w -F c -b -v -f %SVPATH%%DBDUMP% %PRJDB% 
echo Backup Taken Complete %SVPATH%%DBDUMP%