@echo off setlocal EnableExtensions set "BAT_DIR=%~dp0" set "ROOT=" if exist "%BAT_DIR%..\..\artisan" set "ROOT=%BAT_DIR%..\..\" if not defined ROOT if exist "%BAT_DIR%..\..\..\artisan" set "ROOT=%BAT_DIR%..\..\..\" if not defined ROOT if exist "%BAT_DIR%..\..\..\..\artisan" set "ROOT=%BAT_DIR%..\..\..\..\" if not defined ROOT ( echo ERROR: Cannot find artisan from %BAT_DIR% pause exit /b 3 ) cd /d "%ROOT%" if errorlevel 1 ( echo ERROR: Cannot cd to %ROOT% pause exit /b 3 ) set "PHP_EXE=C:\php7\php.exe" if not exist "%PHP_EXE%" ( echo ERROR: PHP not found: %PHP_EXE% pause exit /b 3 ) set "LOG=%BAT_DIR%meter_latest_backfill_282_full.log" echo [%date% %time%] START meter_latest:backfill leaf_group_id=282 > "%LOG%" echo ROOT=%ROOT% >> "%LOG%" echo. >> "%LOG%" REM ========================================================= REM FULL RUN (NO test_limit) REM ========================================================= "%PHP_EXE%" artisan meter_latest:backfill --leaf_group_id=282 --meter_chunk=200 --id_batch=500 --sleep_ms=50 >> "%LOG%" 2>&1 set "EC=%errorlevel%" echo.>> "%LOG%" echo [%date% %time%] END (exit_code=%EC%) >> "%LOG%" type "%LOG%" pause exit /b %EC%