NWCG GARAGE SYSTEM — CRON JOBS
==========================================================================

Set these up in cPanel > Advanced > Cron Jobs.

You need your document root path. In cPanel > File Manager, open the folder
the site lives in and copy the path from the top bar. It usually looks like:

    /home/YOURUSER/garage.northwestcar.group

Substitute that for <DOCROOT> below. Same for <YOURUSER> in the log paths.


--------------------------------------------------------------------------
1. MOT AUTO-CHECK — daily at 8:00am
--------------------------------------------------------------------------
Refreshes MOT data for every car in stock from the DVSA API, and signs off any
MOT that is more than 6 months old so the car moves on through the pipeline
instead of sitting in the MOT queue.

    Minute: 0     Hour: 8     Day: *   Month: *   Weekday: *

Command:
    /usr/bin/php <DOCROOT>/mot-cron.php >> /home/<YOURUSER>/mot-cron.log 2>&1


--------------------------------------------------------------------------
2. CANCELLATION NOTICE CHASER — daily at 9:00am
--------------------------------------------------------------------------
Chases unsigned cancellation notices at 3 and 7 days, and keeps the 14-day
cooling-off countdown up to date.

    Minute: 0     Hour: 9     Day: *   Month: *   Weekday: *

Command:
    /usr/bin/php <DOCROOT>/cancellation-notice-cron.php >> /home/<YOURUSER>/cn-cron.log 2>&1


--------------------------------------------------------------------------
IF YOUR HOST WILL NOT RUN PHP FROM THE COMMAND LINE
--------------------------------------------------------------------------
Both scripts also run over HTTP using the key from your secrets file
(EMAIL_ENC_KEY). Use these instead:

    /usr/bin/curl -s "https://garage.northwestcar.group/mot-cron.php?key=YOURKEY" > /dev/null
    /usr/bin/curl -s "https://garage.northwestcar.group/cancellation-notice-cron.php?key=YOURKEY" > /dev/null

Replace YOURKEY with the EMAIL_ENC_KEY value from nwcg-secrets.php (the file
one level ABOVE the site folder). Anyone with that key can trigger the crons,
so do not paste it anywhere public.


--------------------------------------------------------------------------
TESTING THEM
--------------------------------------------------------------------------
Run each one by hand first, from cPanel > Terminal (or SSH):

    /usr/bin/php <DOCROOT>/mot-cron.php
    /usr/bin/php <DOCROOT>/cancellation-notice-cron.php --dry

The --dry flag on the cancellation cron shows what it WOULD send without
sending anything. Worth doing that one first.

Both print what they did. If you see database errors, the migrations have not
been run yet — go back to step 3 in READ-ME-FIRST.txt.


--------------------------------------------------------------------------
ALREADY-EXISTING CRONS — leave these alone
--------------------------------------------------------------------------
If you already have crons for social-cron.php or garage/cron/openai-feed.php,
they are unchanged by this update.
