Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/paveldanilin/scheduler-bundle

A Symfony scheduler bundle
https://github.com/paveldanilin/scheduler-bundle

job-scheduler symfony task-scheduler

Last synced: 22 days ago
JSON representation

A Symfony scheduler bundle

Awesome Lists containing this project

README

        

## CRON
- @yearly, @annually - Run once a year, midnight, Jan. 1 - 0 0 1 1 *
- @monthly - Run once a month, midnight, first of month - 0 0 1 * *
- @weekly - Run once a week, midnight on Sun - 0 0 * * 0
- @daily, @midnight - Run once a day, midnight - 0 0 * * *
- @hourly - Run once an hour, first minute - 0 * * * *
- @min - Run every minute - * * * * *

```php
use Pada\SchedulerBundle\Annotation\Scheduled;

/**
* @Scheduled(cron=Scheduled::EVERY1MIN)
*/
class EveryMinuteTask
{
public function __invoke(): void
{
// DO SOMETHING
}
}
```

## Interval (sec)

```php
use Pada\SchedulerBundle\Annotation\Scheduled;

/**
* @Scheduled(interval=30)
*/
class EveryMinuteTask
{
public function __invoke(): void
{
// DO SOMETHING EVERY 30 SEC
}
}
```

## Start scheduler
```shell
php ./bin/console scheduler:start
```