PHPackages                             luiswagener/symfony-cron-bundle - 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. [Database &amp; ORM](/categories/database)
4. /
5. luiswagener/symfony-cron-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

luiswagener/symfony-cron-bundle
===============================

Scheduled background jobs for Symfony applications, with persistent tracking of execution history.

0.1(today)00MITPHPPHP &gt;=8.2

Since Jun 10Pushed todayCompare

[ Source](https://github.com/luiswagener/symfony-cron)[ Packagist](https://packagist.org/packages/luiswagener/symfony-cron-bundle)[ RSS](/packages/luiswagener-symfony-cron-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (11)Versions (2)Used By (0)

Symfony Cron Bundle
===================

[](#symfony-cron-bundle)

Contao-style cron framework for Symfony applications. Register cron jobs with a single attribute, run them from a single minutely server cron, and persist last-run timestamps in the database.

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

[](#installation)

```
composer require luiswagener/symfony-cron-bundle
```

Register the bundle in `config/bundles.php`:

```
Luiswagener\SymfonyCronBundle\SymfonyCronBundle::class => ['all' => true],
```

Create the database table:

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

Doctrine must have `auto_mapping: true` (Symfony default) so the bundle entity is discovered automatically.

Server cron
-----------

[](#server-cron)

Configure one minutely cron job on your server:

```
* * * * * /usr/bin/php /path/to/your-app/bin/console cron:run
```

Defining cron jobs
------------------

[](#defining-cron-jobs)

Place a class anywhere under `src/` and annotate it with `#[AsCronJob]`. No service registration or tagging is required — standard Symfony autowiring picks it up automatically.

```
use Luiswagener\SymfonyCronBundle\Attribute\AsCronJob;

#[AsCronJob('hourly')]
final class CleanupExpiredTokensCron
{
    public function __construct(private TokenRepository $tokens) {}

    public function __invoke(): void
    {
        $this->tokens->deleteExpired();
    }
}
```

### Supported intervals

[](#supported-intervals)

- Presets: `minutely`, `hourly`, `daily`, `weekly`, `monthly`, `yearly`
- Cron expressions: `0 * * * *`, `*/5 * * * *`
- Human-readable: `1 minute`, `every 5 minutes`, `1 hour`

Command usage
-------------

[](#command-usage)

```
php bin/console cron:run
php bin/console cron:run "App\\Cron\\CleanupExpiredTokensCron"
php bin/console cron:run --force
php bin/console cron:run "App\\Cron\\CleanupExpiredTokensCron" --force
```

Skipping execution
------------------

[](#skipping-execution)

Throw `CronExecutionSkippedException` to skip a job without updating `last_run`:

```
use Luiswagener\SymfonyCronBundle\Exception\CronExecutionSkippedException;

public function __invoke(string $scope): void
{
    if ($scope !== Cron::SCOPE_CLI) {
        throw new CronExecutionSkippedException();
    }
}
```

License
-------

[](#license)

MIT

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/114886444?v=4)[Luis Wagener](/maintainers/luiswagener)[@luiswagener](https://github.com/luiswagener)

---

Tags

consolecrondoctrinephpschedulersymfonysymfony-bundle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/luiswagener-symfony-cron-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/luiswagener-symfony-cron-bundle/health.svg)](https://phpackages.com/packages/luiswagener-symfony-cron-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M373](/packages/easycorp-easyadmin-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M195](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
