Run a daily task

Send reminders or tidy up data once a day.

Once a day, early in the New Zealand morning, Haume runs your Site's scheduled/daily.php file. New Sites have one that does nothing.

Add a task

Every morning, email people a reminder about classes they've booked for tomorrow.

Your agent writes the job in scheduled/daily.php.

Test it

hm scheduled run --preview   # against Preview's data and secrets
hm scheduled run             # against Live, now
hm logs php                  # see what it did

Write jobs that are safe to repeat

A run can be cut off, and missed days aren't caught up. So:

  • "Send reminders that are due and not yet sent", and record each one as sent.
  • Not "send today's reminders".

Do big jobs in small batches. Runs have time and memory limits.

Stop it

Delete scheduled/daily.php.