ADAM

Cron Service

The Cron service runs every 5 minutes to ensure that background process happen in ADAM. Such processes include:

  1. Regular database snapshots
  2. Processing the messaging queue
  3. Recalculating of changed marks

It is important that the cron service runs regularly. ADAM will notify system administrators by way of an error message on the login page if the cron process has not run for at least 10 minutes:

Setting up the Cron Service

Linux Servers

The following commands should be run to set up the crontab server by an authorised sudo user:

sudo crontab -l -u www-data > ~/tempcron

sudo sed -i "/adam\/cron\.php/d" ~/tempcron

echo "*/5 * * * * php /var/www/adam/cron.php > /dev/null" >> ~/tempcron

sudo crontab -u www-data ~/tempcron

rm ~/tempcron

In order, these commands will:

  1. Get a list of all existing crontab services for the user www-data, stored in a temporary file called “tempcron”.
  2. Remove any lines with “adam/cron.php” in them.
  3. Add in the command to run ADAM’s cron task evert 5 minutes. Note that this command assumes that there is only a single school running on the server who’s configuration is located in the “config.ini” file. If this is not the case, please contact us for more information!
  4. Load the modified cron services.
  5. Remove the temporary file.

Windows Servers

You will need to set up a Scheduled Task to run every 5 minutes. This can be done as follows:

  1. Click on “Start” and type “Task Scheduler” to search for the Windows Task Scheduler.
  2. Create a new task by clicking on “Action” and then “Create Task…”.
  3. Name the task “ADAM Cron”
  4. Click on the “Change User or Group” button. In the bottom text box, type in “SYSTEM” and click on “OK”.
  5. Move to the “Triggers” tag and click on the “New...” button to add a new trigger.
  6. Change the “Settings” option to “Daily”.
  7. Change the start time to midnight (“00:00:00”).
  8. Click on the checkbox “Repeat task every” and in the dropdown list, type “5 minutes”.

  1. Leave all other settings as default and click on the “OK” button.
  2. Click on the “Actions” tag and click on the “New…” button to add a new action.
  3. The program/script should point to the “php.exe” executable on your computer. Search for it in Windows Explorer if required.
  4. In the “Add arguments” box, enter the path to the “cron.php” file within the ADAM source code.

  1. Click on the “OK” button. NOTE THAT YOUR VALUES WILL ALMOST CERTAINLY DIFFER FROM THE IMAGE ABOVE!
  2. Click on the “Settings” tab. Change the setting to “Stop the task if it runs longer than” to 1 hour.

  1. Click on “OK”.