From ee6525b54941082a4b8a61d168367f7ff9dd2933 Mon Sep 17 00:00:00 2001 From: Daniel Stock Date: Sun, 7 Dec 2025 18:07:51 +0100 Subject: [PATCH] Tested and documented cron usage in the README, fixes #166 --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index 6476cdd..41f66b5 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,42 @@ ## Configuration Edit the .env file to configure your database, mail settings, and other environment-specific variables. + +### Running the scheduler + +Some tasks need to be done in regular interval, e. g. syncing data with an axternal CalDAV server. +Therfor the command `artisan schedule:run` should be called every 5 minutes. + +You can choose between one of three updating methods by editing the `app.cron_method` value in the database table `settings`: + +| Value | Description | +| --------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `cron` | If you can, configure a CRON job in the OS | +| `webcron` | Some hosting prividers provide a feature to call a HTTP-request in regular intervals. | +| `request` | If both of the above are not possible in your setup, you can choose `request`. The web UI will then regularly call the `/webcron` route from your browser. | + + +#### Webcron + +Configure a unique token in your `.env`file: + +```.environment +... +WEBCRON_SECRET= +... +``` +Then make sure this URL is called every 5 minutes: + +`http(s):///webcron?token=` + +#### CRON + +Add this line in your crontab by typing `crontab -e`: + +```bash +5 * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1 +``` + ## Usage 1. Access the application at http://localhost:8000.