Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Useful sites and debugging](#useful-sites-and-debugging)
- [Examples](#examples)
- [Logging current time](#logging-current-time)
- [Contao cron](#contao-cron)
- [Drupal cron](#drupal-cron)
- [Laravel cron](#laravel-cron)
- [OpenMage cron](#openmage-cron)
Expand Down Expand Up @@ -87,6 +88,16 @@ Every minute, it writes the current time (UTC timezone) to `./time.log`.
- Restart the DDEV project to start the time example.
- After at least a minute, you should see `./time.log` containing the web container's current time.

### Contao cron

- Create a `./.ddev/web-build/contao.cron` file
- Add the following code to run the Contao scheduler every minute.
- Adjust `php8.4` to match your DDEV project's PHP version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Adjust `php8.4` to match your DDEV project's PHP version

No need to specify php version


```cron
* * * * * /usr/bin/php8.4 /var/www/html/vendor/bin/contao-console contao:cron
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* * * * * /usr/bin/php8.4 /var/www/html/vendor/bin/contao-console contao:cron
* * * * * php contao-console contao:cron

No need to specify php version, and vendor/bin is already in the PATH

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I have done several tests with the following two variants: After each change I ran ddev restart, cleared the Contao cache in the Contao manager and checked if the backend search works (also let it run 3-5 minutes and refreshed the backend).

* * * * * php contao-console contao:cron : The backend search does not work with this short variant and the database cron table is not updated every minute.

* * * * * php /var/www/html/vendor/bin/contao-console contao:cron : This variant works in my tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sorry, I see. It's not a script.

```

### Drupal cron

- Create a `./.ddev/web-build/drupal.cron` file
Expand Down