Hi Darren,
Now that you are on the current version, there is one setup step the video
does not cover, and it is the one most likely to bite you quietly. I would
rather you hear it from me than discover it in three weeks.
TicketsCAD has four background jobs that need something to run them on a
schedule. On a normal server that is handled by the operating system. On
shared hosting like Krystal you have to set it up yourself, and if you do
not, nothing complains - the jobs simply never run. That is the part I want
to save you from.
WHAT THE FOUR JOBS DO
1. PAR scheduler
PAR is the personnel accountability roll call - the "everyone check in and
confirm you are OK" process. This job starts a roll call when one is due,
and marks a unit as missed when they do not answer in time. Without it,
PAR only works if a dispatcher presses the button by hand, and an
unanswered check-in produces silence rather than an alert. This is the one
I would not want left unrun.
2. Notification and pending message sweep
Some messages are deliberately held for a short window before sending, so
a dispatcher can pull one back. This job releases them when the window
closes. It also delivers push notifications, which are queued rather than
sent during the dispatch action itself. Without it, held messages stay
held forever and push notifications never arrive.
3. Webhook retry
If you connect TicketsCAD to another system and a delivery fails, this
retries it. Harmless to skip if you do not use webhooks.
4. Backups
Takes and verifies a database backup on a schedule, and deletes old ones
so they do not pile up. More on this below, because shared hosting has a
wrinkle.
SETTING IT UP ON KRYSTAL
Krystal gives you cron through your control panel - look for "Cron Jobs",
usually under an Advanced section. You are adding four entries.
First you need two things:
The full path to your TicketsCAD folder. From SSH, go into the folder and
run:
pwd
It will look something like /home/yourusername/public_html/tickets
The full path to PHP. Run:
which php
If that gives you nothing useful, your control panel will list the PHP
versions available. You want the command-line one, and you want the same
version the website is using.
Then add these four cron jobs. Replace PHPPATH and TCADPATH with what you
found above.
*/5 * * * * PHPPATH TCADPATH/tools/par_tick.php >/dev/null 2>&1
*/5 * * * * PHPPATH TCADPATH/tools/pending_messages_tick.php >/dev/null 2>&1
*/15 * * * * PHPPATH TCADPATH/tools/webhook_retry_tick.php >/dev/null 2>&1
0 3 * * * PHPPATH TCADPATH/tools/backup_run.php >/dev/null 2>&1
So a finished line looks roughly like:
*/5 * * * * /usr/local/bin/php /home/deakin/public_html/tickets/tools/par_tick.php >/dev/null 2>&1
The first three run every five or fifteen minutes. The last runs once a day
at 3am.
TWO THINGS THAT CATCH PEOPLE OUT
The ">/dev/null 2>&1" on the end is not optional in practice. Without it,
cron emails you the output of every single run. At every five minutes that is
around 288 emails a day from one job alone. Everybody learns this once.
Second, use the command-line PHP, not the web one. On shared hosting they can
be different versions with different settings. If the jobs behave oddly, this
is the first thing to check.
CHECKING THAT IT ACTUALLY WORKED
This is the important bit, and it is why I am writing rather than assuming.
Wait ten minutes after adding the cron jobs, then in TicketsCAD go to
Settings, then Status, and find the Scheduled background jobs section. Each
job shows when it last ran successfully. If a job has never run, it says so
plainly.
Do check this. A cron job that was typed slightly wrong fails silently -
there is no error anywhere, the job simply never happens. The Status page is
the only place that tells you.
ONE ROUGH EDGE, AND I WOULD RATHER WARN YOU THAN HAVE YOU CHASE IT
If the Status page reports a job as not running, the fix it suggests is
currently written for a full server - it will tell you to run commands
starting with systemctl. Those do not exist on shared hosting and you cannot
run them. Ignore that wording. On Krystal the answer is always to check your
cron entry in the control panel.
That is our shortcoming, not yours, and we are fixing the wording so it
matches the kind of hosting you are actually on. In the meantime, do not
spend any time on it.
BACKUPS, AND YOUR DISK QUOTA
Shared hosting gives you a fixed amount of disk space, and database backups
are not small. TicketsCAD is careful about this, but you should know how it
behaves:
- It keeps a limited number of backups and deletes older ones automatically.
- Before writing a new backup it checks free space, and if writing one would
take you below a safe margin it refuses and records why, rather than
filling your account up.
- All of that is adjustable in Settings under Backup and Maintenance -
how many to keep, how many days, and how much free space to protect.
Worth setting the retention to something modest given a shared hosting quota.
Two or three backups is usually plenty if you also download one occasionally.
If you cannot get cron working at all, there is a fallback: TicketsCAD can
take its backup during an ordinary page load instead. It is on by default and
it will keep you covered. The reason it is a fallback rather than the plan is
that the person who happens to load that page waits while the backup runs.
IF SOMETHING DOES NOT LOOK RIGHT
Send me what the Status page shows for the scheduled jobs and the exact cron
lines you entered, and I will spot it. Nine times out of ten it is a path
that is very slightly off.
None of the above is urgent. The system runs fine without it - you just lose
the automatic parts, quietly, which is exactly why I wanted to flag it before
you needed them.
73,
Eric