Madock provides built-in cron support for running scheduled tasks in your PHP projects.
Enable cron:
madock cron:enableDisable cron:
madock cron:disableWhen cron is enabled:
- A cron process starts inside the PHP container
- Custom cron jobs from configuration are installed (if defined)
- Platform-specific cron jobs are installed automatically:
- Magento 2: runs
bin/magento cron:install(installs Magento's built-in cron) - Shopify: installs Laravel scheduler cron job automatically
- Magento 2: runs
- The setting persists across container restarts
You can define custom cron jobs in your project's config.xml. These jobs will be installed automatically when cron is enabled and removed when disabled.
Add jobs to the <cron> section in your config:
<cron>
<enabled>false</enabled>
<jobs>
<job>* * * * * cd /var/www/html && php bin/console scheduled:run</job>
<job>*/5 * * * * cd /var/www/html && php artisan schedule:run</job>
<job>0 * * * * cd /var/www/html && php bin/console cache:clear</job>
</jobs>
</cron>- XML escaping: Use
&instead of&in commands (e.g.,cmd1 && cmd2) - Jobs run as the
www-datauser inside the container - Each
<job>element should contain a complete cron entry (schedule + command) - Jobs are installed/removed together with
cron:enableandcron:disable
┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * * command
Shopware:
<job>* * * * * cd /var/www/html && php bin/console scheduled-task:run</job>
<job>* * * * * cd /var/www/html && php bin/console messenger:consume</job>Laravel/Shopify:
<job>* * * * * cd /var/www/html && php artisan schedule:run</job>Symfony:
<job>* * * * * cd /var/www/html && php bin/console messenger:consume async</job>PrestaShop:
<job>*/15 * * * * cd /var/www/html && php bin/console prestashop:update:configuration</job>Check the Magento cron log:
madock cli "tail -f var/log/cron.log"Check system cron log:
madock cli "tail -f var/log/system.log | grep -i cron"madock logs phpCheck if cron jobs are running:
madock cli "php bin/magento cron:status"List scheduled cron jobs:
madock cli "php bin/magento cron:run --group=default -vvv"- Verify cron is enabled: check your project's
config.xmlfor<cron><enabled>true</enabled></cron> - Rebuild containers:
madock rebuild - Check container logs:
madock logs php
Clear cron schedule:
madock cli "php bin/magento cron:remove"
madock cli "php bin/magento cron:install"| Platform | Cron Support |
|---|---|
| Magento 2 | ✅ Full support |
| Shopware | ✅ Full support |
| PrestaShop | ✅ Full support |
| Shopify | ✅ Full support |
| Custom PHP | ✅ Configurable |