projects / org / se7enxweb / ezplatform-cron
Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
ezplatform-cron | 7x | stable |
Version | Compatible with |
---|---|
N/A | N/A |
This package exposes cron/cron package for use in eZ Platform (or just plain Symfony) via a simle command
ezplatform:cron:run.
This is not a replacement for cron/cron-bundle but rather a simpler alternative to it which can more esaily grow into focusing more on eZ Platform needs in the future including e.g. support for handling cron jobs across a cluster install (separating jobs that should run on all nodes vs jobs that should only be run on one at a time and a lock system to go with it for instance).
Pick your systems cron / scheduling and setup ezplatform:cron:run command to run every minute and optionally specifying category (default: default):
Example for Linux crontab (crontab -e):
* * * * * /path/to/php app/console ezplatform:cron:run [ --category=default] >/dev/null 2>&1
Setting up own cron jobs is as simple as tagging services for your existing Symfony Commands.
The tag takes the following arguments:
date_based_published.cron.publish_scheduled:
class: EzSystems\DateBasedPublisherBundle\Command\PublishScheduledCommand
tags:
- { name: console.command }
- { name: ezplatform.cron.job, schedule: '* * * * *' }
If you want to log outputs of commands processed by run command you have to add the monolog channel cronjob to your configuration.
monolog:
channels: [...,'cronjob']
handlers:
cronjob:
bubble: false
level: info
type: stream
path: '%kernel.logs_dir%/cronjob.log'
channels: [cronjob]