Created
February 27, 2018 18:39
-
-
Save dylanj/4f4e157f7f0df8aad60c0b0a1e77760b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
for /f "tokens=1-4 delims=/ " %%i in ("%date%") do ( | |
set dow=%%i | |
set month=%%j | |
set day=%%k | |
set year=%%l | |
) | |
set datestr=%month%_%day%_%year% | |
echo datestr is %datestr% | |
set BACKUP_FILE=pgdumptest_%datestr%.backup | |
echo backup file name is %BACKUP_FILE% | |
SET PGPASSWORD=test | |
echo on | |
pg_dump -h localhost -p 5432 -U postgres -F c -b -v -f c:\backups\%BACKUP_FILE% postgres | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment