PHPackages                             basecom/akeneo-cron-ui - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. basecom/akeneo-cron-ui

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

basecom/akeneo-cron-ui
======================

This bundle provides an UI for managing Cronjobs in Akeneo

v1.0.0(7y ago)536[1 issues](https://github.com/basecom/akeneo-cronUI/issues)[1 PRs](https://github.com/basecom/akeneo-cronUI/pulls)MITPHP

Since Nov 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/basecom/akeneo-cronUI)[ Packagist](https://packagist.org/packages/basecom/akeneo-cron-ui)[ RSS](/packages/basecom-akeneo-cron-ui/feed)WikiDiscussions develop Synced yesterday

READMEChangelog (1)Dependencies (6)Versions (5)Used By (0)

Basecom CronUI Bundle
=====================

[](#basecom-cronui-bundle)

[![](docs/logo.svg)](docs/logo.svg)

The basecom CronUI is an extension for [Akeneo](https://akeneo.com) community and enterprise edition. It adds a new user interface which can be used to create, manage and delete cronjobs. Also, it allows the developers to create cronjobs through code.

Table of contents
-----------------

[](#table-of-contents)

1. [Installation](#installation)
    1.1 [Requirements](#requirements)
    1.2 [Install the bundle](#install-the-bundle)
2. [Usage](#usage)
    2.1 [Define cronjobs in code](#define-cronjobs-in-code)
    2.1.1 [Symfony Commands](#symfony-commands-commandcronjob)
    2.1.2 [Akeneo Jobs](#akeneo-jobs-jobcronjob)
    2.2 [Registering cronjobs](#registering-cronjobs)
    2.3 [Define cronjobs in ui](#define-cronjobs-in-ui)
3. [Contributing](#contributing)
4. [Authors](#authors)
5. [License](#license)

Installation
------------

[](#installation)

### Requirements

[](#requirements)

This bundle requires **[Akeneo 4.0.33 Community Edition](http://akeneo.com)** or higher. Also it requires **[PHP 7.1](http://php.net)** or higher.

### Install the bundle

[](#install-the-bundle)

1. Install this package via composer:

```
composer require basecom/akeneo-cron-ui
```

2. Follow the installation steps of the [Custom entity bundle](https://github.com/akeneo-labs/CustomEntityBundle) if not already installed.
3. Add the bundle to the `bundles.php`:

```
return [
    \Basecom\Bundle\CronUiBundle\BasecomCronUiBundle::class => ['all' => true],
];
```

4. Run the doctrine schema update to create the new cronjobs table

```
php ./bin/console doctrine:schema:update --dump-sql --env=prod
php ./bin/console doctrine:schema:update --force --env=prod
```

5. Add the `cronjobs:run` command to the crontab:

```
* * * * * cd /path-to-your-project && php ./bin/console cronjobs:run >> /dev/null 2>&1
```

6. Clear all caches and regenerate front-end assets:

```
php ./bin/console cache:clear --env=prod --no-warmup
php ./bin/console cache:warmup --env=prod
php ./bin/console pim:installer:assets --clean --env=prod
yarn run webpack
```

Usage
-----

[](#usage)

There are two ways to create cronjobs. You can create them via the user interface, and you may define them in code. The benefit of creating them via code is that you can execute regular PHP code. The cronjobs defined in the user interface can perform any shell command, including but not limited to the [Symfony commands](https://symfony.com/doc/current/console.html).

### Define cronjobs in code

[](#define-cronjobs-in-code)

Every cronjob needs to implement the interface `Cronjob`. The interface consists of three methods: *getCronExpression*, *execute* and *getLabel*. The *getCronExpression* method can take any valid cron expression including *@daily*, *@monthly* and more. You can read more related to cron expressions [here](http://www.nncron.ru/help/EN/working/cron-format.htm). The *execute* method can run any php code. The *getLabel* method is only used for logging purposes and will never be shown inside the user interface.

A very basic cronjob, which curl's a specific url can be seen here:

```
