rauwekost/schedule-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony2 scheduler for commands

Installs: 312

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Type:symfony-bundle

0.6.1 2015-02-12 14:28 UTC

This package is not auto-updated.

Last update: 2018-04-17 12:31:23 UTC


README

Build Status

This bundle lets you create a cron based schedule to run symfony commands at a given time. The bundle is stil dependant on cron but instead of having a gazillion cron jobs you just define one and the scheduler will take care of the rest.

Installation

TBD

Schedule

#app/config/schedule.yml

monthly_cache_clear:
    command: "cache:clear"
    arguments:
        env:prod
    # "(minute) (hour) (day of month) (month) (day of week) (year[optional])"
    schedule: "00 00 1 * * *"
    exit_on_fail: false
    retry: false

daily_import:
    command: "import:something"
    arguments:
        somearg:3
    schedule: "00 12 * * * *"
    exit_on_fail: true
    retry: true
  • command
    Set the command string, including arguments !Warning don't use spaces in arguments like 'env = prod' always do: 'env=prod'
  • Schedule
    A cron formatted schedule
  • exit_on_fail
    If the scheduler should exit when this command fails
  • retry
    If the scheduler should retry until successfull

Todo and future imporvements

  • Add logging to keep track of completed and failed tasks.
  • Make it possible to run shell commands as well.