How Crunz works: The Event Runner pattern
3.10Crunz allows you to manage cron jobs through PHP code instead of manual crontab entries.
- Define Tasks: Create PHP files (task files) using the
Crunz\ScheduleAPI to define what should run and when. - Single Cron Entry: Instead of many cron entries, you install one single cron job that runs every minute. This entry delegates task execution to the Crunz event runner.
- Execution: The
schedule:runcommand scans your task files and executes any tasks that are due to run at that specific minute.
# Add this to your crontab to run Crunz every minute
* * * * * cd /project && vendor/bin/crunz schedule:run