4)创建SqlBackup.bat
rem 获取当前日期的年、月、日部分
for /f "tokens=1-3 delims=/ " %%a in ("%date%") do (
set "year=%%c"
set "month=%%b"
set "day=%%a"
)
rem 获取当前时间的小时、分钟和秒部分
for /f "tokens=1-3 delims=:." %%a in ("%time%") do (
set "hour=%%a"
set "minute=%%b"
set "second=%%c"
)
set "time=%year%%month%%day%%hour%%minute%%second%"
set "ip=192.168.0.1"
set "db=Platform"
SqlCmd -E -Q "Backup Database %db% To Disk='\\%ip%\ProDbBak\%db%_%time%.bak'"
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/4540.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~