Pro Cron

Mike Perham edited this page Nov 28, 2018 · 1 revision

Faktory Pro can enqueue jobs periodically by adding a TOML file to /etc/faktory/conf.d with your set of cron jobs:

[[cron]]
  schedule = "*/5 * * * *"
  [cron.job]
    type = "FiveJob"
    queue = "critical"
    [cron.job.custom]
      foo = "bar"

[[cron]]
  schedule = "12 * * * *"
  [cron.job]
    type = "HourlyReport"
    retry = 3

[[cron]]
  schedule = "* * * * *"
  [cron.job]
    type = "EveryMinute"

Note the ability to configure the queue, retries and custom job elements. You may have as many TOML files in /etc/faktory/conf.d as you wish, all [[cron]] elements will be merged together.

Faktory Pro will reload cron jobs (really all configuration) without shutting down if you send the HUP signal:

# systemd service
ExecReload=/bin/kill -HUP $MAINPID
> systemctl reload faktory

# docker container
> docker kill --signal=HUP <container>
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.