写了一个脚本,专门用来定时备份数据库表,对变量名进行赋值,注意=左右不能有空格,引用变量用%%var @For /f "tokens=1-3 delims=- " %%a in ('date /t') do (set cdate=%%a-%%b-%%c)
@For /f "tokens=1-2 delims=: " %%a in ('time /t') do (set ctime=%%a:%%b) set t1=nvams.am001_item_type "C:\Program Files (x86)\Postgresql\8.4\bin\pg_dump" --format c --host localhost --port 5432 --username sys_sdm --file "C:\Users\wiliu\Desktop\%t1%%cdate%.backup" --schema nvams --table %t1% "SDE_DEV" 原文链接:https://www.f2er.com/postgresql/196423.html