@echo off & setlocal EnableDelayedExpansion
::数据库密码
set PGPASSWORD=123456
::数据库安装位置
set PGSQL_PATH=D:\Program Files\PostgreSQL\13\bin
::备份文件储存地址
set BACKPATH=D:\sqlbackup
::数据库ip
set HOST=localhost
::数据库端口
set PATH=5432
::数据库名
set DBNAME=car
SET YYYY=%DATE:~0,4%
SET MM=%DATE:~5,2%
SET DD=%DATE:~8,2%
SET HH=%TIME:~0,2%
SET MI=%TIME:~3,2%
SET SS=%TIME:~6,2%
"%PGSQL_PATH%\pg_dump.exe" -h %HOST% -p %PATH% -U postgres -w --role postgres -F c -b -v -f "%BACKPATH%\backup-%HOST%-%YYYY%-%MM%-%DD%-%HH%-%MI%-%SS%.backup" -d %DBNAME%
windows备份postgresql数据库bat脚本
最新推荐文章于 2024-08-09 21:25:57 发布