kfosoft/symfony-crontab

Symfony Crontab

Installs: 21

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

20.10 2020-10-13 15:56 UTC

This package is auto-updated.

Last update: 2024-11-14 01:35:41 UTC


README

Installation

Installation with Composer

Either run

composer require kfosoft/symfony-crontab

Configuring

You have to add crontab configuration into config/packages Example file:

crontab:
  tab:
    # Internal job without params
    SomeJob:
      type: 'internal'
      command: 'symfony:command:name'
      expression: '*/1 * * * *'
    # Internal job with params
    SomeJobWithParams:
      type: 'internal'
      command: 'symfony:command:name'
      expression: '*/1 * * * *'
      params:
        argument1: 'argument'
        --option1: 'long option'
        -t: 'short option'
    # External job example
    ExternalSomeJob:
      type: 'external'
      command: '/bin/bash test -a --opt=123'
      expression: '*/1 * * * *'

Using

bin/console cron:daemon

Supervisor config

[program:symfony-cron]
command=/fullpath/to/bin/console cron:daemon 
autostart=true
autorestart=true
user=user_name_or_id
redirect_stderr=true