- Run
composer require omnilight/yii2-scheduling
to install the scheduling package - Setup a
config/schedule.php
file to house your scheduled processes - Modify your
config/app.php
to include theschedule
component details to run the Craft command (instead ofyii
) - Run
php craft schedule/run --scheduleFile=@config/schedule.php
to process any scheduled operations.
π‘ Tip: You likely want to run php craft schedule/run --scheduleFile=@config/schedule.php
on a cron job that fires every minute!
- The fantastic omnilight/yii2-scheduling package
- Brandon Kelly's mention of how omnilight/yii2-scheduling is used in the craftnet repo