2017 © Pedro Peláez
 

symfony-bundle cron-bundle

With the CronBundle you can configure cron jobs in configuration files

image

mhary/cron-bundle

With the CronBundle you can configure cron jobs in configuration files

  • Friday, December 15, 2017
  • by michalhary
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

MharyCronBundle

Symfony2 / Symfony 3 Bundle for setting up cron jobs via configuration., (*1)

Fork of unsupported skck/SbkCronBundle, (*2)

PHP 7.0+ required, (*3)

Installation

Prerequisites

This bundle requires Symfony 2.1+, (*4)

Now install it with this command:, (*5)

composer require mhary/cron-bundle

Enable the bundle

You need to add the bundle in app/AppKernel.php, (*6)

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Mhary\Bundle\CronBundle\MharyCronBundle(),
    );
}

Import Services

The CronBundle depends on certain services, so you need to import the service configuration in app/config/config.yml, (*7)

imports:
    # ...
    - { resource: @MharyCronBundle/Resources/config/services.yml }

Now you should be able to use the Cron Manager., (*8)

Usage

Configuring Tasks

Tasks can be configured in app/config/config(_prod).yml., (*9)

mhary_cron:
  tasks:
    clearcache:
      command: "cache:clear --env=prod"
      expression: "0 0 * * *"
    listoutput:
      bin: "ls"
      script: ""
      command: "-l > /var/log/listoutput.log"
      expression: "@daily"

Each entry in mhary_cron.tasks represents a task., (*10)

command, (*11)

The command to execute. By default the cron manager will prepend php %kernel.root_dir%/console before the command name, so configuring console commands is easy. You can run every command you want with this bundle, read on how to do so., (*12)

expression, (*13)

The cron expression, any valid expression that you would enter in a cron table., (*14)

bin, (*15)

The binary which will execute the command (php by default, you could enter '' to omit the bin in the execution command), (*16)

script, (*17)

The script that will be called (%kernel.root_dir%/console by default)., (*18)

Runnign the master cron job

Even if you can configure all cron jobs with this bundle, you need to add one line to the crontab manually, the cron:run command., (*19)

* * * * * php /var/www/app/console cron:run

This will execute the cron manager every minute., (*20)

The manager will check which tasks need to be executed and will create background processes for every due task., (*21)

License

The MIT License. For the full text of license, please, see LICENSE, (*22)

The Versions

15/12 2017

dev-master

9999999-dev

With the CronBundle you can configure cron jobs in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Kueck

cronjob bundle symfony3 cron background crontab tasks

15/12 2017

v2.0.2

2.0.2.0

With the CronBundle you can configure cron jobs in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Kueck

cronjob bundle symfony3 cron background crontab tasks

16/11 2017

v2.0.1

2.0.1.0

With the CronBundle you can configure cron jobs in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Kueck

cronjob bundle symfony3 cron background crontab tasks

13/11 2017

v2.0.0

2.0.0.0

With the CronBundle you can configure cron jobs in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Kueck

cronjob bundle symfony3 cron background crontab tasks

17/02 2015

1.0.1

1.0.1.0

With the CronBundle you can configure cron jobs in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Kueck

cronjob symfony2 bundle cron background crontab tasks

12/01 2014

1.0.0

1.0.0.0

With the CronBundle you can configure cron jobs in configuration files

  Sources   Download

MIT

The Requires

 

The Development Requires

by Sebastian Kueck

cronjob symfony2 bundle cron background crontab tasks