2017 © Pedro Peláez
 

symfony-bundle cron-bundle

This bundle provides cron management.

image

greg-doak/cron-bundle

This bundle provides cron management.

  • Tuesday, March 27, 2018
  • by GregDoak
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 100 % Grown

The README.md

CronBundle

This bundle provides cron management utilities for your Symfony Project, (*1)

Installation

Add greg-doak/cron-bundle to your composer.json, (*2)

$ composer require greg-doak/cron-bundle

Register the bundle in config/bundles.php, (*3)

return [
    // ...
    GregDoak\CronBundle\GregDoakCronBundle::class => ['all' => true],
];

Create the database tables, (*4)

$ php bin/console doctrine:migrations:diff
$ php bin/console doctrine:migrations:migrate

Or, (*5)

$ php bin/console doctrine:schema:update --force

Create your first task, (*6)

$ php bin/console cron:create

Configuration

Add the scheduler to your cron, (*7)

*/5 * * * * php /root/to/your/application/bin/console cron:run:scheduled

Or alternatively to run the scheduler on page request Configure services.yaml, (*8)

parameters:
    // ...
    gregdoak.cron.run_on_request: true

This can have performance issues so is recommended to run on Development environments only, (*9)

Usage

Run a single task, you will be prompted for which task to run, (*10)

$ php bin/console cron:run:single

Kill a running task, you will be prompted for the running task, (*11)

$ php bin/console cron:kill

Update a task, (*12)

$ php bin/console cron:update

Notes

There are 3 database tables created:, (*13)

cron_jobs - A record is created whenever the scheduler or single task is run and ensures tasks cannot be ran simultaneously. It also records a start and end time to measure performance of the entire job, (*14)

cron_job_tasks - Each record consists of a single task, running tasks will be reserved by recording a cron_job_id, (*15)

cron_job_logs - A log is created for each task to record the output, exit code, start and end times, (*16)

The Versions

27/03 2018

dev-master

9999999-dev https://github.com/gregdoak/CronBundle

This bundle provides cron management.

  Sources   Download

MIT

The Requires

 

orm log bundle doctrine symfony cron