Skip to content

dspsofts/cronmanager-bundle

Repository files navigation

DspSoftsCronManagerBundle

Latest Version Software License Build Status Coverage Status Quality Score

The DspSoftsCronManagerBundle provides a simple way to launch and control any cron job.

Installation

Step 1: Download the Bundle

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

$ composer require dspsofts/cronmanager-bundle

This command requires you to have Composer installed globally, as explained in the installation chapter_ of the Composer documentation.

Step 2: Enable the Bundle

Then, enable the bundle by adding the following line in the app/AppKernel.php file of your project:

// app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new DspSofts\CronManagerBundle\DspSoftsCronManagerBundle(),
        );
        // ...
    }
    // ...
}

Step 3: Configure the bundle

You need to specify where to put the log files in your app/config/config.yml :

# app/config/config.yml
dsp_softs_cron_manager:
    logs_dir: "%kernel.logs_dir%/cronmanager/%kernel.environment%"

Step 4: Add the runner command to your crontab

This cron manager uses a main command which runs all crons. The command dsp:cron:run should be run every minute. In order to do this, you can put this line in your crontab:

* * * * * /path/to/symfony/app/console dsp:cron:run

Please be aware that the user which owns the crontab needs to have whatever permissions you need for your cron tasks.

License

This bundle is under the MIT license. See the complete license in the bundle:

Resources/meta/LICENSE