[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 批处理远程备份log报错

文件远程备份,写了个批处理,但无法正常执行,日志里报错说有ERROR,请各大侠帮忙看看,哪有问题
批处理:
  1. echo Trac僨乕僞僐僺乕(%FROMDIR%%BACKUPDIR%佀%SERVERIP%%TODIR%%BACKUPDIR%) >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
  2. net use %SERVERIP%%TODIR% %COPYPWD% /user:%COPYUSER%
  3. robocopy %FROMDIR%%BACKUPDIR% %SERVERIP%%TODIR%%BACKUPDIR% /e /mir /copyall /v /zb /copy:dt /dcopy:t  
  4. IF NOT ERRORLEVEL 1 GOTO  E_COPY1
  5. LIB\JOBMSG ERROR COPY1 %ERRORLEVEL%
  6. echo         Trac僨乕僞僐僺乕偵幐攕偟傑偟偨丅 >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
  7. GOTO E_COPY1
  8. :E_COPY1
复制代码
log:
##########################################################
# JOB-ID WUXI0004               START  10/08/05-18:53:00 #
##########################################################
##########################################################
# JOB-ID WUXI0004 COPY1       1 ERROR  10/08/05-18:54:52 #
##########################################################
##########################################################
# JOB-ID WUXI0004               END    10/08/05-18:54:55 #
##########################################################

不知是那错了?

没有高手来指点么?????????????

TOP

乱码可以不用考虑,是因为语言是日文的

TOP

SLEEP 10

SET JOBNAME=WUXI0004
SET SERVERIP=\\192.168.1.10
SET FROMDIR=D:\SDWorkbenchServer\projects
SET TODIR=\SDWorkbenchServer\projects
SET BACKUPDIR=\trac
SET COPYUSER=copyuser
SET COPYPWD=copyuser

D:
cd \san
lib\JOBMSG START

rem echo ******************************************************* >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem echo     SD儚乕僋儀儞僠僒乕價僗掆巭  丂丂  %DATE% %TIME%     >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem echo ******************************************************* >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt

rem net stop "SDWorkbenchServer" >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem IF NOT ERRORLEVEL 1 GOTO  E_STOP
rem LIB\JOBMSG ERROR STOP1 %ERRORLEVEL%
rem echo         SD儚乕僋儀儞僠僒乕價僗掆巭偵幐攕偟傑偟偨丅 >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem GOTO JOB_END
rem :E_STOP

echo ******************************************************* >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
echo     SD儚乕僋儀儞僠偺僶僢僋傾僢僾 丂 丂%DATE% %TIME%     >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
echo ******************************************************* >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt

echo Trac僨乕僞僐僺乕(%FROMDIR%%BACKUPDIR%佀%SERVERIP%%TODIR%%BACKUPDIR%) >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
net use %SERVERIP%%TODIR% %COPYPWD% /user:%COPYUSER%
robocopy %FROMDIR%%BACKUPDIR% %SERVERIP%%TODIR%%BACKUPDIR% /e /mir /copyall /v /zb /copy:dt /dcopy:t  
IF NOT ERRORLEVEL 1 GOTO  E_COPY1
LIB\JOBMSG ERROR COPY1 %ERRORLEVEL%
echo         Trac僨乕僞僐僺乕偵幐攕偟傑偟偨丅 >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
GOTO E_COPY1
:E_COPY1

echo Trac/SVN擣徹僼傽僀儖僐僺乕(%FROMDIR%佀%SERVERIP%%TODIR%) >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
copy %FROMDIR%\trac.htdigest %SERVERIP%%TODIR% /Y
copy %FROMDIR%\svnauthz %SERVERIP%%TODIR% /Y
IF NOT ERRORLEVEL 1 GOTO  E_COPY2
LIB\JOBMSG ERROR COPY2 %ERRORLEVEL%
echo         Trac/SVN擣徹僼傽僀儖僐僺乕偵幐攕偟傑偟偨丅 >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
GOTO E_COPY2
:E_COPY2

rem echo ******************************************************* >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem echo     SD儚乕僋儀儞僠僒乕價僗嵞婲摦丂丂  %DATE% %TIME%     >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem echo ******************************************************* >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt

rem net start "SDWorkbenchServer" >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem IF NOT ERRORLEVEL 1 GOTO  E_START
rem LIB\JOBMSG ERROR START1 %ERRORLEVEL%
rem echo         SD儚乕僋儀儞僠僒乕價僗嵞婲摦偵幐攕偟傑偟偨丅 >> log\WUXI0004_%Date:~0,4%%Date:~5,2%%Date:~8,2%.txt
rem GOTO JOB_END
rem :E_START

LIB\JOBMSG END
:JOB_END

TOP

完整代码贴出来看看?
我帮忙写的代码不需要付钱。如果一定要给,请在微信群或QQ群发给大家吧。
【微信公众号、微信群、QQ群】http://bbs.bathome.net/thread-3473-1-1.html
【支持批处理之家,加入VIP会员!】http://bbs.bathome.net/thread-67716-1-1.html

TOP

怎么没人来指点指点?

TOP

返回列表