Tested and documented cron usage in the README, fixes #166
This commit is contained in:
@@ -74,6 +74,42 @@ ## Configuration
|
|||||||
|
|
||||||
Edit the .env file to configure your database, mail settings, and other environment-specific variables.
|
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=<YOUR_TOKEN>
|
||||||
|
...
|
||||||
|
```
|
||||||
|
Then make sure this URL is called every 5 minutes:
|
||||||
|
|
||||||
|
`http(s)://<YOUR-URL>/webcron?token=<YOUR_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
|
## Usage
|
||||||
|
|
||||||
1. Access the application at http://localhost:8000.
|
1. Access the application at http://localhost:8000.
|
||||||
|
|||||||
Reference in New Issue
Block a user