Skip to content

Cron job and hosting without a command line

Kasmin needs one cron job that runs every minute. It sends the mail queue, reminders, digests and automations. If it is missing, administrators get the notification “Cron job not configured” and the system status page shows an error.

Linux server with crontab (crontab -e as the user that owns the Kasmin files):

* * * * * cd /path/to/kasmin && php artisan schedule:run >> /dev/null 2>&1

Docker: run the scheduler in the container, e.g. with a second service that executes php artisan schedule:work, or a host cron job docker exec kasmin php artisan schedule:run.

Web hosting whose cron jobs can only call URLs (e.g. all-inkl.com): set KASMIN_HOOK_TOKEN in .env (at least 32 random characters) and create a cron job that calls this URL every minute:

https://your-kasmin-domain.example/system/cron?token=YOUR_TOKEN

At all-inkl.com: KAS → Tools → Cronjobs → Neuen Cronjob anlegen: protocol https, the URL above (without https://), interval “every minute” (* for minute, hour, day, month and weekday), a description such as “Kasmin scheduler”. The answer of the URL is a short JSON text with "ok":true.

Many web hosting packages offer no SSH access and run cron jobs only as HTTP calls. Kasmin therefore offers protected HTTP hooks. They are disabled unless KASMIN_HOOK_TOKEN is set in .env (at least 32 random characters). The token is sent as Authorization: Bearer <token>; services that cannot send headers may use ?token=<token> (cron only).

Hook Purpose
POST /system/hooks/upgrade Runs the upgrade (kasmin:upgrade, with backup) – call it after uploading a new release
GET or POST /system/cron Runs the scheduler once (mail queue, automations, reminders) – call it every few minutes from the hosting’s cron job function
POST /system/hooks/demo Demo instances only (APP_ENV=demo): installs Kasmin with fictitious demo data if the database is empty

Use HTTPS only. A wrong or missing token answers “404 Not Found”, so the hooks cannot be discovered.

Demo instances use APP_ENV=demo and these settings:

Setting Meaning
KASMIN_DEMO_LOCALE de or en: language of the demo data and the default content
KASMIN_DEMO_ADMIN_EMAIL address of the first administrator
KASMIN_DEMO_EMAIL_DOMAIN domain of the fictitious people’s e-mail addresses – with a catch-all mailbox for this domain, all login links of the demo can be read there