Cron bundle

Installs: 18

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 15

Forks: 0


v1.0.1 2017-11-21 08:18 UTC

This package is auto-updated.

Last update: 2024-05-08 06:29:20 UTC


This package exposes cron/cron package for use in eZ Platform (or just plain Symfony) via a simle command ezpublish: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).

Setup system cron

Pick your systems cron / scheduling and setup ezpublish:cron:run command to run every minute and optionally specifying category (default: default):

Example for Linux crontab (crontab -e):

* * * * * /path/to/php app/console ezpublish:cron:run [ --category=default] >/dev/null 2>&1

Setting up own cron commands

Setting up own cron jobs is as simple as tagging services for your existing Symfony Commands.

The tag takes the following arguments:

  • name: ezpublish.cron.job
  • schedule: Takes any kind of format supported by cron/cron, which mimics linux crontab format. E.g. * * * * *
  • category: (Optional, by default: default) Lets you separate cronjobs that should be run under different logic then default, e.g. infrequent jobs (NOTE: Means end user will need to setup several entries in his crontab to run all categories!)


        class: EzSystems\DateBasedPublisherBundle\Command\PublishScheduledCommand
            - { name: console.command }
            - { name: ezpublish.cron.job, schedule: '* * * * *' }