This script lets you auto-process all the data from KAMAR, as long as you have it set up the Auto Upload Scripts.
If you host with me:
This will be set up automatically for you, but you still need to set up the Auto Upload Scripts
If you host yourself you can then either
– run using the batch script (you’ll need to copy and edit this first) if on windows
– or running on the command line in linux ($ php autoprocess.php) – must be in the correct directory first
The autoprocess.bat file looks like this:
@echo off cd C:\inetpub\kamar-web\wwwroot\assay\ for /F "usebackq tokens=1,2 delims==" %%i in (`wmic os get LocalDateTime /VALUE 2^>NUL`) do if '.%%i.'=='.LocalDateTime.' set ldt=%%j set ldt=%ldt:~0,4%-%ldt:~4,2%-%ldt:~6,2%-%ldt:~8,2%%ldt:~10,2%-%ldt:~12,6% "C:\Program Files (x86)\PHP\v5.6\php.exe" -f autoprocess.php >C:\assaylogs\%ldt%.txt 2>&1
The parts you will need to change are in the bottom line:
C:\inetpub\kamar-web\wwwroot\assay\ is the location of the autoprocess.php file
C:\Program Files (x86)\PHP\v5.6\php.exe is the path to your PHP installation
C:\assaylogs\ is where you want the log files to be saved (they are automatically timestamped… that is what the %ldt% does)
You should make a copy of it before you set it up, as the default autoprocess.bat file will be overwritten on the next update.
You can also set it up to run automatically by setting up a “scheduled task” that runs the run.bat file if on Windows (when setting it up make sure you set the “Start in” as the assay root directory) or setting up a cron job similar to below (this will run every weekday at 2am) if on linux.
0 2 * * 1,2,3,4,5 cd /path/to/assay && php autoprocess.php > /logs/assay.log 2>&1
Timing suggestions
We have ours running every day… for a school of 1500 it takes about 10 minutes to process, so suggest starting at 6:30am you ideally want it running at a time where no one will be using it, and it must start after the files have been uploaded from the Auto Upload Scripts