我正在尝试使用Windows任务调度程序为PostgreSQL 9.3设置数据库自动备份,这里是批处理代码,但它没有带回任何东西,我缺少什么?
@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 PGPATH=C:\Program Files\PostgreSQL\9.3\bin\
SET SVPATH=C:\Users\......\Documents\PostgresqlBack\backup\
set datestr=%month%_%day%_%year%
echo datestr is %datestr%
set BACKUP_FILE=<NameOfTheFile>_%datestr%.backup
echo backup file name is %BACKUP_FILE%
SET PGPASSWORD=<test_user>
echo on
%PGPATH% -i -h <localhost> -p 5432 -U <test123> -F c -b -v -f %SVPATH%%BACKUP_FILE% <test>