se7enxweb / ezplatform-cron
Simple cron bundle for eZ Platform
Installs: 10
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 5
Type:ezplatform-bundle
Requires
- php: ^7.3
- cron/cron: ^1.4
- ezsystems/ezplatform-kernel: ^4.0
- symfony/config: ^5.0
- symfony/console: ^5.0
- symfony/dependency-injection: ^5.0
- symfony/http-kernel: ^5.0
- symfony/process: ^5.0
Requires (Dev)
- ezsystems/doctrine-dbal-schema: ^4.0
- ezsystems/ezplatform-code-style: ^0.2.0
- friendsofphp/php-cs-fixer: ^2.16.3
- phpunit/phpunit: ^6.4 || ^7.0
Replaces
- v4.0.0-alpha2
- v4.0.0-alpha1
- 3.1.x-dev
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.1.0-rc2
- v3.1.0-rc1
- v3.1.0-beta1
- 3.0.x-dev
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-rc1
- v3.0.0-beta3
- v3.0.0-beta2
- v3.0.0-beta1
- 2.0.x-dev
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.1-rc1
- v2.0.0
- v2.0.0-rc1
- v2.0.0-beta1
- 1.0.x-dev
- v1.0.1
- v1.0.0
- v1.0.0-rc1
- v1.0.0-beta1
- dev-snapshot-master
- dev-IBX-394-problem-with-siteaccess-in-cronjob
This package is auto-updated.
Last update: 2025-08-24 22:54:33 UTC
README
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).
Setup system cron
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 commands
Setting up own cron jobs is as simple as tagging services for your existing Symfony Commands.
The tag takes the following arguments:
name
:ezplatform.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!)options
: (Optional, by default:''
) Takes custom option/s in string format which are added to the command. (E.g. '--keep=0 --status=draft' for running the cleanup versions command)
Example
date_based_published.cron.publish_scheduled: class: EzSystems\DateBasedPublisherBundle\Command\PublishScheduledCommand tags: - { name: console.command } - { name: ezplatform.cron.job, schedule: '* * * * *' }
Logging run command
If you want to log outputs of commands processed by run command you have to add the monolog channel cronjob
to your configuration.
Example
monolog: channels: [...,'cronjob'] handlers: cronjob: bubble: false level: info type: stream path: '%kernel.logs_dir%/cronjob.log' channels: [cronjob]