From b3c80e6ecf653ce621ff3f2aacf036a9cd17c2ba Mon Sep 17 00:00:00 2001 From: Thomas Casteleyn Date: Mon, 18 Mar 2019 14:32:02 +0100 Subject: [PATCH] Added changes as requested --- webservices/cron.cmd | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/webservices/cron.cmd b/webservices/cron.cmd index 7729af356..15418780c 100644 --- a/webservices/cron.cmd +++ b/webservices/cron.cmd @@ -5,14 +5,19 @@ REM REM schtasks /create /tn "iTop Cron" /sc minute /tr "\"C:\www\iTop\webservices\cron.cmd\"" REM REM -REM PHP_PATH must point to php.exe, adjust the path to suit your own installation -SET PHP_PATH=%~f1 +REM PHP_COMMAND must point to php.exe, adjust the first to suit your own installation +REM %~f1 expand the first argument to a fully qualified path name +SET PHP_COMMAND=%~f1 REM PHP_INI must contain the full path to a PHP.ini file suitable for Command Line mode execution +REM %~dp1 expands to the path of the first argument (php command) SET PHP_INI=%~dp1php.ini -REM The double dash (--) separates the parameters parsed by php.exe from the script's specific parameters -REM %~p0 expands to the path to this file (including the trailing backslash) -SET CRON_SCRIPT=%~dp0cron.php +REM %~dp0 expands to the path to this file (including the trailing backslash) +SET CRON_PATH=%~dp0 REM Adjust the path below if you use a param files stored in a different location -SET PARAMS_FILE=%~dp0cron.params +SET PARAMS_FILE=%CRON_PATH%cron.params +REM Adjust the path below if you want the log files stored in a different location +SET LOG_FILE=%CRON_PATH%..\log\cron.log +REM REM Actual PHP invocation -"%PHP_PATH%" -c "%PHP_INI%" -f "%CRON_SCRIPT%" -- --param_file="%PARAMS_FILE%" --verbose=1 >> "%~dp0..\log\cron.log" +REM The double dash (--) separates the parameters parsed by php.exe from the script's specific parameters +"%PHP_COMMAND%" -c "%PHP_INI%" -f "%CRON_PATH%cron.php" -- --param_file="%PARAMS_FILE%" --verbose=1 >> "%LOG_FILE%"