从另一个批处理文件示例运行厨房pentaho批处理Windows脚本

时间:2022-05-12 02:31:43

I am having issues at running the kitchen.bat file from another batch file

我在从另一个批处理文件运行kitchen.bat文件时遇到问题

@echo off
setlocal enableDelayedExpansion 

REM IF EXIST "%ProgramFiles(x86)%\Transform.exe" 
SET Transform="%ProgramFiles(x86)%\Transform.exe"
set tmpDate=%date%
set tmpTime=%time: =0%
set varDate=%tmpDate:~6,4%%tmpDate:~3,2%%tmpDate:~0,2%
set varTime=%tmpTime:~0,2%%tmpTime:~3,2%%tmpTime:~6,2%
set varDateLog=%tmpDate:~0,2%/%tmpDate:~3,2%/%tmpDate:~6,4%
set varTimeLog=%tmpTime:~0,2%:%tmpTime:~3,2%:%tmpTime:~6,2% 
set Traitement=%~n0%~x0
set "varKettleDir=%ProgramFiles(x86)%\PENTAHO_data-integration";%varKettleDir%
set varDir=%HOMEDRIVE%\Temp\advans\bi\cm
set varLog=%varDir%\logBatch
set LOG=%varLog%\AdvansCam_%varDate%_%varTime%.log
set ADV_ETL_CLIENT=%HOMEDRIVE%\SVN\ADV_ETL_CLIENT_REP

REM %Transform% -s:"%~f1" -xsl:"%~dpn0.xsl" 2>NUL

REM ENDLOCAL
REM GOTO:EOF


REM :Syntax
REM 


echo %varDateLog% %tmpTime:~0,2%:%tmpTime:~3,2%:%tmpTime:~6,2% ^| ... Erreur : Le paramètre Date arreté n'est pas présent >> %LOG%
echo %varLog%\Advans_CamInit%~x0^| Debut du traitement >> %LOG%
echo ~x0=%~x0 >> %LOG%
echo ~x=%~n0%~x0 >> %LOG%
rem -- PENTAHO DATA INTEGRATION
REM set varPentaho= "%varKettleDir%\kitchen.bat /file:%ADV_ETL_CLIENT%\J_STG_push.kjb /level:Basic > %varLog%\JobCamClient_%varDate%_%varTime%.log"
REM call %varPentaho% && echo %varPentaho% "OK" || echo %varPentaho%"NOK" >> %LOG%
REM echo Debut du traitement >> %LOG%
cmd kitchen.bat /file:%ADV_ETL_CLIENT%\J_STG_push.kjb /level:Basic > %varLog%\JobCamClient_%varDate%_%varTime%.log" && echo "OK" || echo "NOK" >> %LOG%

1 个解决方案

#1


try with this line:

尝试这一行:

call  kitchen.bat /file:%ADV_ETL_CLIENT%\J_STG_push.kjb /level:Basic > %varLog%\JobCamClient_%varDate%_%varTime%.log"  && (
  echo "OK">>%LOG%
) || (
  echo "NOK" >> %LOG%
)

instead of your last one.

而不是你的最后一个。

#1


try with this line:

尝试这一行:

call  kitchen.bat /file:%ADV_ETL_CLIENT%\J_STG_push.kjb /level:Basic > %varLog%\JobCamClient_%varDate%_%varTime%.log"  && (
  echo "OK">>%LOG%
) || (
  echo "NOK" >> %LOG%
)

instead of your last one.

而不是你的最后一个。