Symfony2 scheduler for commands
This bundle lets you create a cron based schedule to run symfony commands at a given time. The bundle is stil dependant on cron but instead of having a gazillion cron jobs you just define one and the scheduler will take care of the rest.
#app/config/schedule.yml monthly_cache_clear: command: "cache:clear" arguments: env:prod # "(minute) (hour) (day of month) (month) (day of week) (year[optional])" schedule: "00 00 1 * * *" exit_on_fail: false retry: false daily_import: command: "import:something" arguments: somearg:3 schedule: "00 12 * * * *" exit_on_fail: true retry: true
Set the command string, including arguments !Warning don't use spaces in arguments like 'env = prod' always do: 'env=prod'
A cron formatted schedule
If the scheduler should exit when this command fails
If the scheduler should retry until successfull
- Add logging to keep track of completed and failed tasks.
- Make it possible to run shell commands as well.