关于CMD批处理的问题:for /f "tokens=1-4 delims=/ " %%i in ('date /t') do set date=%%i
为ORACLE数据库设置自动备份做的autoback.bat批处理文件,让WINDOWS2008计划任务自动执行autoback.bat内容如下:echooffsetnl...
为ORACLE数据库设置自动备份 做的autoback.bat批处理文件,让WINDOWS 2008计划任务自动执行
autoback.bat内容如下:
echo off
set nls_lang=AMERICAN_AMERICA.ZHS16GBK
path=%path%;C:\Program Files\WinRAR
for /f "tokens=1-4 delims=/ " %%i in ('date /t') do set date=%%i
exp hnlj/hnlj@hnlj file =d:\auto_backup\hnlj%date%.dmp log=d:\auto_backup\hnlj%date%.log
exp iufo/iufo@hnlj file =d:\auto_backup\iufo%date%.dmp log=d:\auto_backup\iufo%date%.log
rar a d:\auto_backup\hnlj%date%.rar d:\auto_backup\hnlj%date%.*
rar a d:\auto_backup\iufo%date%.rar d:\auto_backup\iufo%date%.*
del d:\auto_backup\hnlj%date%.dmp
del d:\auto_backup\hnlj%date%.log
del d:\auto_backup\iufo%date%.dmp
del d:\auto_backup\iufo%date%.log
echo on
结果第二天得到的压缩文件仅仅是 hnlj2014.rar 取不到月和日。请问是什么问题。
PS:之前服务器未做系统得到的就是hnlj2014-11-02.rar的文件,现在重新做了系统,就取不到月和日了。请高手解答 展开
autoback.bat内容如下:
echo off
set nls_lang=AMERICAN_AMERICA.ZHS16GBK
path=%path%;C:\Program Files\WinRAR
for /f "tokens=1-4 delims=/ " %%i in ('date /t') do set date=%%i
exp hnlj/hnlj@hnlj file =d:\auto_backup\hnlj%date%.dmp log=d:\auto_backup\hnlj%date%.log
exp iufo/iufo@hnlj file =d:\auto_backup\iufo%date%.dmp log=d:\auto_backup\iufo%date%.log
rar a d:\auto_backup\hnlj%date%.rar d:\auto_backup\hnlj%date%.*
rar a d:\auto_backup\iufo%date%.rar d:\auto_backup\iufo%date%.*
del d:\auto_backup\hnlj%date%.dmp
del d:\auto_backup\hnlj%date%.log
del d:\auto_backup\iufo%date%.dmp
del d:\auto_backup\iufo%date%.log
echo on
结果第二天得到的压缩文件仅仅是 hnlj2014.rar 取不到月和日。请问是什么问题。
PS:之前服务器未做系统得到的就是hnlj2014-11-02.rar的文件,现在重新做了系统,就取不到月和日了。请高手解答 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询