A DDEV add-on that runs scheduled cron jobs in the web container using Supercronic.
Unlike the system cron daemon, Supercronic inherits the full container
environment — DDEV variables like IS_DDEV_PROJECT, database credentials, and
TYPO3_CONTEXT are automatically available to every job without any inline
exports.
ddev add-on get astehlik/ddev-supercronic
ddev restartAdd one or more *.cron files to .ddev/web-build/. Each file uses standard
crontab syntax (no username column).
On ddev start, all .ddev/web-build/*.cron files are concatenated into a
single crontab and executed by Supercronic inside the web container.
An example job is provided at .ddev/web-build/time.cron.example. Rename it to
activate it:
mv .ddev/web-build/time.cron.example .ddev/web-build/time.cron
ddev restartAfter at least a minute, ./time.log should appear in your project root
containing the current time written by the example job.
Because Supercronic inherits the container environment, IS_DDEV_PROJECT and
similar variables do not need to be set explicitly in cron files.
* * * * * cd /var/www/html && vendor/bin/typo3 scheduler:runFeel free to contribute own working examples for other systems.
- Use crontab guru to build schedule expressions.
- Inspect the active crontab with
ddev exec cat /etc/supercronic/crontab. - Connect to the web container with
ddev sshto run commands manually. - To run jobs on local time instead of UTC, set timezone in
.ddev/config.yaml.
This add-on is a drop-in replacement for
ddev/ddev-cron. Both use the same
.ddev/web-build/*.cron file format and location, so existing cron files work
without any changes.
ddev add-on remove ddev/ddev-cron
ddev add-on get astehlik/ddev-supercronic
ddev restartBecause Supercronic inherits the full container environment, any
IS_DDEV_PROJECT=true or other explicit env var prefixes in your cron commands
are no longer necessary, though leaving them in place is harmless.
ddev add-on remove astehlik/ddev-supercronicThe add-on version tracks the Supercronic version it ships. A GitHub Actions workflow checks for new Supercronic releases every Monday and opens a pull request with the update.