window postgresql备份脚本

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

@ECHO OFF
@ECHO ============================
@ECHO PostgreSQL Backup Command
@ECHO ============================
@set DirName=%date:~0,7%
@set FileName=%date:~0,10%.backup

@if %date:~8,2% == 01 (md D:\Backup\”%DirName%”)
@if not exist D:\Backup\”%DirName%” (md D:\Backup\”%DirName%”)
“C:\Program Files\PostgreSQL\9.3\bin\pg_dump.exe” -i -h localhost-p 5432 -U sec -b -c -C -d -D -Fc -v -f D:\Backup\%FileName% techpro_db

if exist D:\Backup\%FileName% (“C:\Program Files\WinRAR\WinRAR.exe” a -df D:\Backup\%FileName%.rar D:\Backup\%FileName%)
@ECHO ON