The DspSoftsCronManagerBundle provides a simple way to launch and control any cron job.
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.
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(),
);
// ...
}
// ...
}
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%"
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.
This bundle is under the MIT license. See the complete license in the bundle:
Resources/meta/LICENSE