yacron


Nameyacron JSON
Version 0.19.0 PyPI version JSON
download
home_pagehttps://github.com/gjcarneiro/yacron
SummaryA modern Cron replacement that is Docker-friendly
upload_time2023-03-11 13:55:05
maintainer
docs_urlNone
authorGustavo Carneiro
requires_python>=3.7
licenseMIT license
keywords yacron
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            ================
Yet Another Cron
================


A modern Cron replacement that is Docker-friendly


* Free software: MIT license

Features
--------

* "Crontab" is in YAML format;
* Builtin sending of Sentry and Mail outputs when cron jobs fail;
* Flexible configuration: you decide how to determine if a cron job fails or not;
* Designed for running in Docker, Kubernetes, or 12 factor environments:

  * Runs in the foreground;
  * Logs everything to stdout/stderr [1]_;

* Option to automatically retry failing cron jobs, with exponential backoff;
* Optional HTTP REST API, to fetch status and start jobs on demand;
* Arbitrary timezone support;


.. [1] Whereas vixie cron only logs to syslog, requiring a syslog daemon to be running in the background or else you don't get logs!

Status
--------------

The project is in beta stage: essential features are complete, and the focus is
finding and fixing bugs before the first stable release.

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

Install using pip
+++++++++++++++++

yacron requires Python >= 3.6 (for systems with older Python, use the binary instead).  It is advisable to install it in a Python
virtual environment, for example:

.. code-block:: shell

    python3 -m venv yacronenv
    . yacronenv/bin/activate
    pip install yacron

Install using pipx
++++++++++++++++++

pipx_ automates creating a virtualenv and installing a python program in the
newly created virtualenv.  It is as simple as:

.. code-block:: shell

    pipx install yacron

.. _pipx: https://github.com/pipxproject/pipx

Install using binary
++++++++++++++++++++

Alternatively, a self-contained binary can be downloaded
from github: https://github.com/gjcarneiro/yacron/releases. This binary should
work on any Linux 64-bit system post glibc 2.23 (e.g. Ubuntu:16.04).  Python is not required on the target system (it is embedded in the executable).

Usage
-----

Configuration is in YAML format.  To start yacron, give it a configuration file
or directory path as the ``-c`` argument.  For example::

    yacron -c /tmp/my-crontab.yaml

This starts yacron (always in the foreground!), reading
``/tmp/my-crontab.yaml`` as configuration file.  If the path is a directory,
any ``*.yaml`` or ``*.yml`` files inside this directory are taken as
configuration files.

Configuration basics
++++++++++++++++++++

This configuration runs a command every 5 minutes:

.. code-block:: yaml

    jobs:
      - name: test-01
        command: echo "foobar"
        shell: /bin/bash
        schedule: "*/5 * * * *"

The command can be a string or a list of strings.  If command is a string,
yacron runs it through a shell, which is ``/bin/bash`` in the above example, but
is ``/bin/sh`` by default.

If the command is a list of strings, the command is executed directly, without a
shell.  The ARGV of the command to execute is extracted directly from the
configuration:

.. code-block:: yaml

    jobs:
      - name: test-01
        command:
          - echo
          - foobar
        schedule: "*/5 * * * *"


The `schedule` option can be a string in a crontab format specified by https://github.com/josiahcarlson/parse-crontab (this module is used by yacron).
Additionally @reboot can be included , which will only run the job when yacron is initially
executed. Further `schedule` can be an object with properties.  The following configuration
runs a command every 5 minutes, but only on the specific date 2017-07-19, and
doesn't run it in any other date:

.. code-block:: yaml

    jobs:
      - name: test-01
        command: echo "foobar"
        schedule:
          minute: "*/5"
          dayOfMonth: 19
          month: 7
          year: 2017
          dayOfWeek: "*"

Important: by default all time is interpreted to be in UTC, but you can
request to use local time instead.  For instance, the cron job below runs
every day at 19h27 *local time* because of the ``utc: false`` option:

.. code-block:: yaml

  jobs:
    - name: test-01
      command: echo "hello"
      schedule: "27 19 * * *"
      utc: false
      captureStdout: true

Since Yacron version 0.11, you can also request that the schedule be
interpreted in an arbitrary timezone, using the ``timezone`` attribute:

.. code-block:: yaml

  jobs:
    - name: test-01
      command: echo "hello"
      schedule: "27 19 * * *"
      timezone: America/Los_Angeles
      captureStdout: true


You can ask for environment variables to be defined for command execution:

.. code-block:: yaml

    jobs:
      - name: test-01
        command: echo "foobar"
        shell: /bin/bash
        schedule: "*/5 * * * *"
        environment:
          - key: PATH
            value: /bin:/usr/bin

You can also provide an environment file to define environments for command execution:

.. code-block:: yaml

    jobs:
      - name: test-01
        command: echo "foobar"
        shell: /bin/bash
        schedule: "*/5 * * * *"
        env_file: .env

The env file must be a list of ``KEY=VALUE`` pairs. Empty lines and lines starting with ``#`` will be ignored.

Variables declared in the ``environment`` option will override those found in the ``env_file``.


Specifying defaults
+++++++++++++++++++


There can be a special ``defaults`` section in the config.  Any attributes
defined in this section provide default values for cron jobs to inherit.
Although cron jobs can still override the defaults, as needed:

.. code-block:: yaml

    defaults:
        environment:
          - key: PATH
            value: /bin:/usr/bin
        shell: /bin/bash
        utc: false
    jobs:
      - name: test-01
        command: echo "foobar"  # runs with /bin/bash as shell
        schedule: "*/5 * * * *"
      - name: test-02  # runs with /bin/sh as shell
        command: echo "zbr"
        shell: /bin/sh
        schedule: "*/5 * * * *"

Note: if the configuration option is a directory and there are multiple configuration files in that directory, then the ``defaults`` section in each configuration file provides default options only for cron jobs inside that same file; the defaults have no effect beyond any individual YAML file.

Reporting
+++++++++

Yacron has builtin support for reporting jobs failure (more on that below) by
email, Sentry and shell command (additional reporting methods might be added in the future):

.. code-block:: yaml

  - name: test-01
    command: |
      echo "hello" 1>&2
      sleep 1
      exit 10
    schedule:
      minute: "*/2"
    captureStderr: true
    onFailure:
      report:
        sentry:
          dsn:
            value: example
            # Alternatively:
            # fromFile: /etc/secrets/my-secret-dsn
            # fromEnvVar: SENTRY_DSN
          fingerprint:  # optional, since yacron 0.6
            - yacron
            - "{{ environment.HOSTNAME }}"
            - "{{ name }}"
          extra:
            foo: bar
            zbr: 123
          level: warning
          environment: production
        mail:
          from: example@foo.com
          to: example@bar.com
          smtpHost: 127.0.0.1
          # optional fields:
          username: "username1"  # set username and password to enable login
          password:
            value: example
            # Alternatively:
            # fromFile: /etc/secrets/my-secret-password
            # fromEnvVar: MAIL_PASSWORD
          tls: false  # set to true to enable TLS
          starttls: false  # set to true to enable StartTLS
        shell:
          shell: /bin/bash
          command: ...

Here, the ``onFailure`` object indicates that what to do when a job failure
is detected.  In this case we ask for it to be reported both to sentry and by
sending an email.

The ``captureStderr: true`` part instructs yacron to capture output from the the
program's `standard error`, so that it can be included in the report.  We could
also turn on `standard output` capturing via the ``captureStdout: true`` option.
By default, yacron captures only standard error.  If a cron job's standard error
or standard output capturing is not enabled, these streams will simply write to
the same standard output and standard error as yacron itself.

Both `stdout` and `stderr` stream lines are by default prefixed with
``[{job_name} {stream_name}]``, i.e. ``[test-01 stdout]``, if for any reason you
need to change this, provide the option ``streamPrefix`` (new in version 0.16)
with your own custom string.

.. code-block:: yaml

  - name: test-01
    command: echo "hello world"
    schedule:
      minute: "*/2"
    captureStdout: true
    streamPrefix: "[{job_name} job]"

In some cases, for instance when you're logging JSON objects you might want to
completely get rid of the prefix altogether:

.. code-block:: yaml

  - name: test-01
    command: echo "hello world"
    schedule:
      minute: "*/2"
    captureStdout: true
    streamPrefix: ""

It is possible also to report job success, as well as failure, via the
``onSuccess`` option.

.. code-block:: yaml

  - name: test-01
    command: echo "hello world"
    schedule:
      minute: "*/2"
    captureStdout: true
    onSuccess:
      report:
        mail:
          from: example@foo.com
          to: example@bar.com
          smtpHost: 127.0.0.1

Since yacron 0.5, it is possible to customise the format of the report. For
``mail`` reporting, the option ``subject`` indicates what is the subject of the
email, while ``body`` formats the email body.  For Sentry reporting, there is
only ``body``.  In all cases, the values of those options are strings that are
processed by the jinja2_ templating engine.  The following variables are
available in templating:

* name(str): name of the cron job
* success(bool): whether or not the cron job succeeded
* stdout(str): standard output of the process
* stderr(str): standard error of the process
* exit_code(int): process exit code
* command(str): cron job command
* shell(str): cron job shell
* environment(dict): subprocess environment variables

.. _jinja2: http://jinja.pocoo.org/

Example:

.. code-block:: yaml

  - name: test-01
    command: |
      echo "hello" 1>&2
      sleep 1
      exit 10
    schedule:
      minute: "*/2"
    captureStderr: true
    onFailure:
      report:
        mail:
          from: example@foo.com
          to: example@bar.com
          smtpHost: 127.0.0.1
          subject: Cron job '{{name}}' {% if success %}completed{% else %}failed{% endif %}
          body: |
            {{stderr}}
            (exit code: {{exit_code}})


The shell reporter (since yacron 0.13) executes a user given shell command in
the specified shell. It passes all environment variables from the python
executable and specifies some additional ones to inform about the state of the
job:

* YACRON_FAIL_REASON (str)
* YACRON_FAILED ("1" or "0")
* YACRON_JOB_NAME (str)
* YACRON_JOB_COMMAND (str)
* YACRON_JOB_SCHEDULE (str)
* YACRON_RETCODE (str)
* YACRON_STDERR (str)
* YACRON_STDOUT (str)

A simple example configuration:

.. code-block:: yaml

  - name: test-01
    command: echo "foobar" && exit 123
    shell: /bin/bash
    schedule: "* * * * *"
    onFailure:
      report:
        shell:
          shell: /bin/bash
          command: echo "Error code $YACRON_RETCODE"

Since yacron 0.15, it is possible to send emails formatted as html, by  adding
the ``html: true`` property.  For example, here the standard output of a shell
command is captured and interpreted as html and placed in the email message\:

.. code-block:: yaml

  - name: test-01
    command: echo "hello <b>world</b>"
    schedule: "@reboot"
    captureStdout: true
    onSuccess:
      report:
        mail:
          from: example@foo.com
          to: example@bar.com, zzz@sleep.com
          html: true
          smtpHost: 127.0.0.1
          smtpPort: 1025
          subject: This is a cron job with html body


Metrics
+++++++++

Yacron has builtin support for writing job metrics to Statsd_:

.. _Statsd: https://github.com/etsy/statsd

.. code-block:: yaml

    jobs:
      - name: test01
        command: echo "hello"
        schedule: "* * * * *"
        statsd:
          host: my-statsd.example.com
          port: 8125
          prefix: my.cron.jobs.prefix.test01

With this config Yacron will write the following metrics over UDP
to the Statsd listening on ``my-statsd.example.com:8125``:

.. code-block::

  my.cron.jobs.prefix.test01.start:1|g  # this one is sent when the job starts
  my.cron.jobs.prefix.test01.stop:1|g   # the rest are sent when the job stops
  my.cron.jobs.prefix.test01.success:1|g
  my.cron.jobs.prefix.test01.duration:3|ms|@0.1


Handling failure
++++++++++++++++

By default, yacron considers that a job has `failed` if either the process
returns a non-zero code or if it generates output to `standard error` (and
standard error capturing is enabled, of course).

You can instruct yacron how to determine if a job has failed or not via the
``failsWhen`` option:

.. code-block:: yaml

  failsWhen:
    producesStdout: false
    producesStderr: true
    nonzeroReturn: true
    always: false

producesStdout
    If true, any captured standard output causes yacron to consider the job
    as failed.  This is false by default.

producesStderr
    If true, any captured standard error causes yacron to consider the job
    as failed.  This is true by default.

nonzeroReturn
    If true, if the job process returns a code other than zero causes yacron
    to consider the job as failed.  This is true by default.

always
    If true, if the job process exits that causes yacron to consider the job as
    failed.  This is false by default.

It is possible to instruct yacron to retry failing cron jobs by adding a
``retry`` option inside ``onFailure``:

.. code-block:: yaml

  - name: test-01
    command: |
      echo "hello" 1>&2
      sleep 1
      exit 10
    schedule:
      minute: "*/10"
    captureStderr: true
    onFailure:
      report:
        mail:
          from: example@foo.com
          to: example@bar.com
          smtpHost: 127.0.0.1
      retry:
        maximumRetries: 10
        initialDelay: 1
        maximumDelay: 30
        backoffMultiplier: 2

The above settings tell yacron to retry the job up to 10 times, with the delay
between retries defined by an exponential backoff process: initially 1 second,
doubling for every retry up to a maximum of 30 seconds. A value of -1 for
maximumRetries will mean yacron will keep retrying forever, this is mostly
useful with a schedule of "@reboot" to restart a long running process when it
has failed.

If the cron job is expected to fail sometimes, you may wish to report only in
the case the cron job ultimately fails after all retries and we give up on it.
For that situation, you can use the ``onPermanentFailure`` option:

.. code-block:: yaml

  - name: test-01
    command: |
      echo "hello" 1>&2
      sleep 1
      exit 10
    schedule:
      minute: "*/10"
    captureStderr: true
    onFailure:
      retry:
        maximumRetries: 10
        initialDelay: 1
        maximumDelay: 30
        backoffMultiplier: 2
    onPermanentFailure:
      report:
        mail:
          from: example@foo.com
          to: example@bar.com
          smtpHost: 127.0.0.1

Concurrency
+++++++++++
Sometimes it may happen that a cron job takes so long to execute that when the moment its next scheduled execution is reached a previous instance may still be running.  How yacron handles this situation is controlled by the option ``concurrencyPolicy``, which takes one of the following values:

Allow
    allows concurrently running jobs (default)
Forbid
    forbids concurrent runs, skipping next run if previous hasn’t finished yet
Replace
    cancels currently running job and replaces it with a new one

Execution timeout
+++++++++++++++++

(new in version 0.4)

If you have a cron job that may possibly hang sometimes, you can instruct yacron
to terminate the process after N seconds if it's still running by then, via the
``executionTimeout`` option.  For example, the following cron job takes 2
seconds to complete, yacron will terminate it after 1 second:

.. code-block:: yaml

  - name: test-03
    command: |
      echo "starting..."
      sleep 2
      echo "all done."
    schedule:
      minute: "*"
    captureStderr: true
    executionTimeout: 1  # in seconds

When terminating a job, it is always a good idea to give that job process some
time to terminate properly.  For example, it may have opened a file, and even if
you tell it to shutdown, the process may need a few seconds to flush buffers and
avoid losing data.

On the other hand, there are times when programs are buggy and simply get stuck,
refusing to terminate nicely no matter what.  For this reason, yacron always
checks if a process exited some time after being asked to do so. If it hasn't,
it tries to forcefully kill the process.  The option ``killTimeout`` option
indicates how many seconds to wait for the process to gracefully terminate
before killing it more forcefully.  In Unix systems, we first send a SIGTERM,
but if the process doesn't exit after ``killTimeout`` seconds (30 by default)
then we send SIGKILL.  For example, this cron job ignores SIGTERM, and so yacron
will send it a SIGKILL after half a second:

.. code-block:: yaml

  - name: test-03
    command: |
      trap "echo '(ignoring SIGTERM)'" TERM
      echo "starting..."
      sleep 10
      echo "all done."
    schedule:
      minute: "*"
    captureStderr: true
    executionTimeout: 1
    killTimeout: 0.5

Change to another user/group
++++++++++++++++++++++++++++

(new in version 0.11)

You can request that Yacron change to another user and/or group for a specific
cron job.  The field ``user`` indicates the user (uid or userame) under which
the subprocess must be executed.  The field ``group`` (gid or group name)
indicates the group id.  If only ``user`` is given, the group defaults to the
main group of that user.  Example:

.. code-block:: yaml

  - name: test-03
    command: id
    schedule:
      minute: "*"
    captureStderr: true
    user: www-data

Naturally, yacron must be running as root in order to have permissions to
change to another user.


Remote web/HTTP interface
+++++++++++++++++++++++++

(new in version 0.10)

If you wish to remotely control yacron, you can optionally enable an HTTP REST
interface, with the following configuration (example):

.. code-block:: yaml

  web:
    listen:
       - http://127.0.0.1:8080
       - unix:///tmp/yacron.sock

Now you have the following options to control it (using HTTPie as example):

Get the version of yacron:
##########################

.. code-block:: shell

  $ http get http://127.0.0.1:8080/version
  HTTP/1.1 200 OK
  Content-Length: 22
  Content-Type: text/plain; charset=utf-8
  Date: Sun, 03 Nov 2019 19:48:15 GMT
  Server: Python/3.7 aiohttp/3.6.2

  0.10.0b3.dev7+g45bc4ce

Get the status of cron jobs:
############################

.. code-block:: shell

  $ http get http://127.0.0.1:8080/status
  HTTP/1.1 200 OK
  Content-Length: 104
  Content-Type: text/plain; charset=utf-8
  Date: Sun, 03 Nov 2019 19:44:45 GMT
  Server: Python/3.7 aiohttp/3.6.2

  test-01: scheduled (in 14 seconds)
  test-02: scheduled (in 74 seconds)
  test-03: scheduled (in 14 seconds)

You may also get status info in json format:

.. code-block:: shell

  $ http get http://127.0.0.1:8080/status Accept:application/json
  HTTP/1.1 200 OK
  Content-Length: 206
  Content-Type: application/json; charset=utf-8
  Date: Sun, 03 Nov 2019 19:45:53 GMT
  Server: Python/3.7 aiohttp/3.6.2

  [
      {
          "job": "test-01",
          "scheduled_in": 6.16588,
          "status": "scheduled"
      },
      {
          "job": "test-02",
          "scheduled_in": 6.165787,
          "status": "scheduled"
      },
      {
          "job": "test-03",
          "scheduled_in": 6.165757,
          "status": "scheduled"
      }
  ]

Start a job right now:
######################

Sometimes it's useful to start a cron job right now, even if it's not
scheduled to run yet, for example for testing:

.. code-block:: shell

  $ http post http://127.0.0.1:8080/jobs/test-02/start
  HTTP/1.1 200 OK
  Content-Length: 0
  Content-Type: application/octet-stream
  Date: Sun, 03 Nov 2019 19:50:20 GMT
  Server: Python/3.7 aiohttp/3.6.2


Includes
++++++++

(new in version 0.13)

You may have a use case where it's convenient to have multiple config files,
and choose at runtime which one to use.  In that case, it might be useful if
you can put common definitions (such as defaults for reporting, shell, etc.)
in a separate file, that is included by the other files.

To support this use case, it is possible to ask one config file to include
another one, via the ``include`` directive.  It takes a list of file names:
those files will be parsed as configuration and merged in with this file.

Example, your main config file could be:

.. code-block:: yaml

  include:
    - _inc.yaml

  jobs:

    - name: my job
      ...

And your included ``_inc.yaml`` file could contain some useful defaults:


.. code-block:: yaml

  defaults:
    shell: /bin/bash
    onPermanentFailure:
      report:
        sentry:
          ...

Custom logging
++++++++++++++

It's possible to provide a custom logging configuration, via the ``logging``
configuration section.  For example, the following configuration displays log lines with
an embedded timestamp for each message.

.. code-block:: yaml

    logging:
      # In the format of:
      # https://docs.python.org/3/library/logging.config.html#dictionary-schema-details
      version: 1
      disable_existing_loggers: false
      formatters:
        simple:
          format: '%(asctime)s [%(processName)s/%(threadName)s] %(levelname)s (%(name)s): %(message)s'
      handlers:
        console:
          class: logging.StreamHandler
          level: DEBUG
          formatter: simple
          stream: ext://sys.stdout
      root:
        level: INFO
        handlers:
          - console

Obscure configuration options
+++++++++++++++++++++++++++++

enabled: true|false (default true)
##################################

(new in yacron 0.18)

It is possible to disable a specific cron job by adding a `enabled: false` option.  Jobs
with `enabled: false` will simply be skipped, as if they aren't there, apart from
validating the configuration.

.. code-block:: yaml

    jobs:
      - name: test-01
        enabled: false  # this cron job will not run until you change this to `true`
        command: echo "foobar"
        shell: /bin/bash
        schedule: "* * * * *"




=======
History
=======

0.19.0 (2023-03-11)
-------------------

* Add ability to configure yacron's own logging (#81 #82 #83, gjcarneiro, bdamian)
* Add config value for SMTP(validate_certs=False) (David Batley)

0.18.0 (2023-01-01)
-------------------

* fixes "Job is always executed immediately on yacron start" (#67)
* add an `enabled` option in jobs (#73)
* give a better error message when no configuration file is provided or exists (#72)

0.17.0 (2022-06-26)
-------------------

* Support Additional Shell Report Vars (RJ Garcia)
* Shell reporter: handle long lines truncatation (Hannes Hergeth)
* exe: undo pyinstaller LD_LIBRARY_PATH changes in subprocesses (#68, Gustavo Carneiro)


0.16.0 (2021-12-05)
-------------------

* make the capture max line length configurable and change the default
  from 64K to 16M (#56)
* Add config option to change prefix of subprocess stream lines (#58, eelkeh)


0.15.1 (2021-11-19)
-------------------

* Fix a bug in the --validate option (#57, Leonid Repin)


0.15.0 (2021-11-10)
-------------------

* Allow emails to be html formatted
* Fix an error when reading cmd output with huge lines (#56)


0.14.0 (2021-10-04)
-------------------

* Sentry: increase the size of messages before getting truncated #54
* Sentry: allow specifying the environment option #53
* Minor fixes


0.13.1 (2021-08-10)
-------------------

* unicode fixes for the exe binary version

0.13.0 (2021-06-28)

* Add ability for one config file to include another one #38
* Add shell command reporting ability (Hannes Hergeth, #50)


0.12.2 (2021-05-31)
-------------------

* constrain ruamel.yaml to version 0.17.4 or below, later versions are buggy


0.12.1 (2021-05-30)
-------------------

* blacklist ruamel.yaml version 0.17.5 in requirements #47


0.12.0 (2021-04-22)
-------------------

* web: don't crash when receiving a web request without Accept header (#45)
* add env_file configuration option (Alessandro Romani, #43)
* email: add missing Date header (#39)


0.11.2 (2020-11-29)
-------------------

* Add back a self contained binary, this time based on PyInstaller

0.11.1 (2020-07-29)
-------------------

* Fix email reporting when multiple recipients given


0.11.0 (2020-07-20)
-------------------

* reporting: add a failure reason line at the top of sentry/email (#36)
* mail: new tls, startls, username, and password options (#21)
* allow jobs to run as a different user (#18)
* Support timezone schedule (#26)


0.10.1 (2020-06-02)
-------------------

* Minor bugfixes


0.10.0 (2019-11-03)
-------------------

* HTTP remote interface, allowing to get job status and start jobs on demand
* Simple Linux binary including all dependencies (built using PyOxidizer)

0.10.0b2 (2019-10-26)
---------------------

* Build Linux binary inside Docker Ubuntu 16.04, so that it is compatible with
  older glibc systems

0.10.0b1 (2019-10-13)
---------------------
* Build a standalone Linux binary, using PyOxidizer
* Switch from raven to sentry-sdk

0.9.0 (2019-04-03)
------------------
* Added an option to just check if the yaml file is valid without running the scheduler.
* Fix missing `body` in the schema for sentry config


0.8.1 (2018-10-16)
------------------
* Fix a bug handling ``@reboot`` in schedule (#22)

0.8.0 (2018-05-14)
------------------
* Sentry: add new ``extra`` and ``level`` options.


0.7.0 (2018-03-21)
------------------

* Added the ``utc`` option and document that times are utc by default (#17);
* If an email body is empty, skip sending it;
* Added docker and k8s example.


0.6.0 (2017-11-24)
------------------
* Add custom Sentry fingerprint support
* Ability to send job metrics to statsd (thanks bofm)
* ``always`` flag to consider any cron job that exits to be failed
  (thanks evanjardineskinner)
* `maximumRetries` can now be ``-1`` to never stop retrying (evanjardineskinner)
* ``schedule`` can be the string ``@reboot`` to always run that cron job on startup
  (evanjardineskinner)
* ``saveLimit`` can be set to zero (evanjardineskinner)

0.5.0
------------------
* Templating support for reports
* Remove deprecated smtp_host/smtp_port

0.4.3 (2017-09-13)
------------------
* Bug fixes

0.4.2 (2017-09-07)
------------------
* Bug fixes

0.4.1 (2017-08-03)
------------------

* More polished handling of configuration errors;
* Unit tests;
* Bug fixes.

0.4.0 (2017-07-24)
------------------

* New option ``executionTimeout``, to terminate jobs that get stuck;
* If a job doesn't terminate gracefully kill it.  New option ``killTimeout``
  controls how much time to wait for graceful termination before killing it;
* Switch parsing to strictyaml, for more user friendly parsing validation error
  messages.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gjcarneiro/yacron",
    "name": "yacron",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "yacron",
    "author": "Gustavo Carneiro",
    "author_email": "gustavocarneiro@gambitresearch.com",
    "download_url": "https://files.pythonhosted.org/packages/d2/95/890428da58784bafd48c260eb351656af3389c506affad225f1c7c19bf5b/yacron-0.19.0.tar.gz",
    "platform": null,
    "description": "================\nYet Another Cron\n================\n\n\nA modern Cron replacement that is Docker-friendly\n\n\n* Free software: MIT license\n\nFeatures\n--------\n\n* \"Crontab\" is in YAML format;\n* Builtin sending of Sentry and Mail outputs when cron jobs fail;\n* Flexible configuration: you decide how to determine if a cron job fails or not;\n* Designed for running in Docker, Kubernetes, or 12 factor environments:\n\n  * Runs in the foreground;\n  * Logs everything to stdout/stderr [1]_;\n\n* Option to automatically retry failing cron jobs, with exponential backoff;\n* Optional HTTP REST API, to fetch status and start jobs on demand;\n* Arbitrary timezone support;\n\n\n.. [1] Whereas vixie cron only logs to syslog, requiring a syslog daemon to be running in the background or else you don't get logs!\n\nStatus\n--------------\n\nThe project is in beta stage: essential features are complete, and the focus is\nfinding and fixing bugs before the first stable release.\n\nInstallation\n------------\n\nInstall using pip\n+++++++++++++++++\n\nyacron requires Python >= 3.6 (for systems with older Python, use the binary instead).  It is advisable to install it in a Python\nvirtual environment, for example:\n\n.. code-block:: shell\n\n    python3 -m venv yacronenv\n    . yacronenv/bin/activate\n    pip install yacron\n\nInstall using pipx\n++++++++++++++++++\n\npipx_ automates creating a virtualenv and installing a python program in the\nnewly created virtualenv.  It is as simple as:\n\n.. code-block:: shell\n\n    pipx install yacron\n\n.. _pipx: https://github.com/pipxproject/pipx\n\nInstall using binary\n++++++++++++++++++++\n\nAlternatively, a self-contained binary can be downloaded\nfrom github: https://github.com/gjcarneiro/yacron/releases. This binary should\nwork on any Linux 64-bit system post glibc 2.23 (e.g. Ubuntu:16.04).  Python is not required on the target system (it is embedded in the executable).\n\nUsage\n-----\n\nConfiguration is in YAML format.  To start yacron, give it a configuration file\nor directory path as the ``-c`` argument.  For example::\n\n    yacron -c /tmp/my-crontab.yaml\n\nThis starts yacron (always in the foreground!), reading\n``/tmp/my-crontab.yaml`` as configuration file.  If the path is a directory,\nany ``*.yaml`` or ``*.yml`` files inside this directory are taken as\nconfiguration files.\n\nConfiguration basics\n++++++++++++++++++++\n\nThis configuration runs a command every 5 minutes:\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test-01\n        command: echo \"foobar\"\n        shell: /bin/bash\n        schedule: \"*/5 * * * *\"\n\nThe command can be a string or a list of strings.  If command is a string,\nyacron runs it through a shell, which is ``/bin/bash`` in the above example, but\nis ``/bin/sh`` by default.\n\nIf the command is a list of strings, the command is executed directly, without a\nshell.  The ARGV of the command to execute is extracted directly from the\nconfiguration:\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test-01\n        command:\n          - echo\n          - foobar\n        schedule: \"*/5 * * * *\"\n\n\nThe `schedule` option can be a string in a crontab format specified by https://github.com/josiahcarlson/parse-crontab (this module is used by yacron).\nAdditionally @reboot can be included , which will only run the job when yacron is initially\nexecuted. Further `schedule` can be an object with properties.  The following configuration\nruns a command every 5 minutes, but only on the specific date 2017-07-19, and\ndoesn't run it in any other date:\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test-01\n        command: echo \"foobar\"\n        schedule:\n          minute: \"*/5\"\n          dayOfMonth: 19\n          month: 7\n          year: 2017\n          dayOfWeek: \"*\"\n\nImportant: by default all time is interpreted to be in UTC, but you can\nrequest to use local time instead.  For instance, the cron job below runs\nevery day at 19h27 *local time* because of the ``utc: false`` option:\n\n.. code-block:: yaml\n\n  jobs:\n    - name: test-01\n      command: echo \"hello\"\n      schedule: \"27 19 * * *\"\n      utc: false\n      captureStdout: true\n\nSince Yacron version 0.11, you can also request that the schedule be\ninterpreted in an arbitrary timezone, using the ``timezone`` attribute:\n\n.. code-block:: yaml\n\n  jobs:\n    - name: test-01\n      command: echo \"hello\"\n      schedule: \"27 19 * * *\"\n      timezone: America/Los_Angeles\n      captureStdout: true\n\n\nYou can ask for environment variables to be defined for command execution:\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test-01\n        command: echo \"foobar\"\n        shell: /bin/bash\n        schedule: \"*/5 * * * *\"\n        environment:\n          - key: PATH\n            value: /bin:/usr/bin\n\nYou can also provide an environment file to define environments for command execution:\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test-01\n        command: echo \"foobar\"\n        shell: /bin/bash\n        schedule: \"*/5 * * * *\"\n        env_file: .env\n\nThe env file must be a list of ``KEY=VALUE`` pairs. Empty lines and lines starting with ``#`` will be ignored.\n\nVariables declared in the ``environment`` option will override those found in the ``env_file``.\n\n\nSpecifying defaults\n+++++++++++++++++++\n\n\nThere can be a special ``defaults`` section in the config.  Any attributes\ndefined in this section provide default values for cron jobs to inherit.\nAlthough cron jobs can still override the defaults, as needed:\n\n.. code-block:: yaml\n\n    defaults:\n        environment:\n          - key: PATH\n            value: /bin:/usr/bin\n        shell: /bin/bash\n        utc: false\n    jobs:\n      - name: test-01\n        command: echo \"foobar\"  # runs with /bin/bash as shell\n        schedule: \"*/5 * * * *\"\n      - name: test-02  # runs with /bin/sh as shell\n        command: echo \"zbr\"\n        shell: /bin/sh\n        schedule: \"*/5 * * * *\"\n\nNote: if the configuration option is a directory and there are multiple configuration files in that directory, then the ``defaults`` section in each configuration file provides default options only for cron jobs inside that same file; the defaults have no effect beyond any individual YAML file.\n\nReporting\n+++++++++\n\nYacron has builtin support for reporting jobs failure (more on that below) by\nemail, Sentry and shell command (additional reporting methods might be added in the future):\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: |\n      echo \"hello\" 1>&2\n      sleep 1\n      exit 10\n    schedule:\n      minute: \"*/2\"\n    captureStderr: true\n    onFailure:\n      report:\n        sentry:\n          dsn:\n            value: example\n            # Alternatively:\n            # fromFile: /etc/secrets/my-secret-dsn\n            # fromEnvVar: SENTRY_DSN\n          fingerprint:  # optional, since yacron 0.6\n            - yacron\n            - \"{{ environment.HOSTNAME }}\"\n            - \"{{ name }}\"\n          extra:\n            foo: bar\n            zbr: 123\n          level: warning\n          environment: production\n        mail:\n          from: example@foo.com\n          to: example@bar.com\n          smtpHost: 127.0.0.1\n          # optional fields:\n          username: \"username1\"  # set username and password to enable login\n          password:\n            value: example\n            # Alternatively:\n            # fromFile: /etc/secrets/my-secret-password\n            # fromEnvVar: MAIL_PASSWORD\n          tls: false  # set to true to enable TLS\n          starttls: false  # set to true to enable StartTLS\n        shell:\n          shell: /bin/bash\n          command: ...\n\nHere, the ``onFailure`` object indicates that what to do when a job failure\nis detected.  In this case we ask for it to be reported both to sentry and by\nsending an email.\n\nThe ``captureStderr: true`` part instructs yacron to capture output from the the\nprogram's `standard error`, so that it can be included in the report.  We could\nalso turn on `standard output` capturing via the ``captureStdout: true`` option.\nBy default, yacron captures only standard error.  If a cron job's standard error\nor standard output capturing is not enabled, these streams will simply write to\nthe same standard output and standard error as yacron itself.\n\nBoth `stdout` and `stderr` stream lines are by default prefixed with\n``[{job_name} {stream_name}]``, i.e. ``[test-01 stdout]``, if for any reason you\nneed to change this, provide the option ``streamPrefix`` (new in version 0.16)\nwith your own custom string.\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: echo \"hello world\"\n    schedule:\n      minute: \"*/2\"\n    captureStdout: true\n    streamPrefix: \"[{job_name} job]\"\n\nIn some cases, for instance when you're logging JSON objects you might want to\ncompletely get rid of the prefix altogether:\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: echo \"hello world\"\n    schedule:\n      minute: \"*/2\"\n    captureStdout: true\n    streamPrefix: \"\"\n\nIt is possible also to report job success, as well as failure, via the\n``onSuccess`` option.\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: echo \"hello world\"\n    schedule:\n      minute: \"*/2\"\n    captureStdout: true\n    onSuccess:\n      report:\n        mail:\n          from: example@foo.com\n          to: example@bar.com\n          smtpHost: 127.0.0.1\n\nSince yacron 0.5, it is possible to customise the format of the report. For\n``mail`` reporting, the option ``subject`` indicates what is the subject of the\nemail, while ``body`` formats the email body.  For Sentry reporting, there is\nonly ``body``.  In all cases, the values of those options are strings that are\nprocessed by the jinja2_ templating engine.  The following variables are\navailable in templating:\n\n* name(str): name of the cron job\n* success(bool): whether or not the cron job succeeded\n* stdout(str): standard output of the process\n* stderr(str): standard error of the process\n* exit_code(int): process exit code\n* command(str): cron job command\n* shell(str): cron job shell\n* environment(dict): subprocess environment variables\n\n.. _jinja2: http://jinja.pocoo.org/\n\nExample:\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: |\n      echo \"hello\" 1>&2\n      sleep 1\n      exit 10\n    schedule:\n      minute: \"*/2\"\n    captureStderr: true\n    onFailure:\n      report:\n        mail:\n          from: example@foo.com\n          to: example@bar.com\n          smtpHost: 127.0.0.1\n          subject: Cron job '{{name}}' {% if success %}completed{% else %}failed{% endif %}\n          body: |\n            {{stderr}}\n            (exit code: {{exit_code}})\n\n\nThe shell reporter (since yacron 0.13) executes a user given shell command in\nthe specified shell. It passes all environment variables from the python\nexecutable and specifies some additional ones to inform about the state of the\njob:\n\n* YACRON_FAIL_REASON (str)\n* YACRON_FAILED (\"1\" or \"0\")\n* YACRON_JOB_NAME (str)\n* YACRON_JOB_COMMAND (str)\n* YACRON_JOB_SCHEDULE (str)\n* YACRON_RETCODE (str)\n* YACRON_STDERR (str)\n* YACRON_STDOUT (str)\n\nA simple example configuration:\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: echo \"foobar\" && exit 123\n    shell: /bin/bash\n    schedule: \"* * * * *\"\n    onFailure:\n      report:\n        shell:\n          shell: /bin/bash\n          command: echo \"Error code $YACRON_RETCODE\"\n\nSince yacron 0.15, it is possible to send emails formatted as html, by  adding\nthe ``html: true`` property.  For example, here the standard output of a shell\ncommand is captured and interpreted as html and placed in the email message\\:\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: echo \"hello <b>world</b>\"\n    schedule: \"@reboot\"\n    captureStdout: true\n    onSuccess:\n      report:\n        mail:\n          from: example@foo.com\n          to: example@bar.com, zzz@sleep.com\n          html: true\n          smtpHost: 127.0.0.1\n          smtpPort: 1025\n          subject: This is a cron job with html body\n\n\nMetrics\n+++++++++\n\nYacron has builtin support for writing job metrics to Statsd_:\n\n.. _Statsd: https://github.com/etsy/statsd\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test01\n        command: echo \"hello\"\n        schedule: \"* * * * *\"\n        statsd:\n          host: my-statsd.example.com\n          port: 8125\n          prefix: my.cron.jobs.prefix.test01\n\nWith this config Yacron will write the following metrics over UDP\nto the Statsd listening on ``my-statsd.example.com:8125``:\n\n.. code-block::\n\n  my.cron.jobs.prefix.test01.start:1|g  # this one is sent when the job starts\n  my.cron.jobs.prefix.test01.stop:1|g   # the rest are sent when the job stops\n  my.cron.jobs.prefix.test01.success:1|g\n  my.cron.jobs.prefix.test01.duration:3|ms|@0.1\n\n\nHandling failure\n++++++++++++++++\n\nBy default, yacron considers that a job has `failed` if either the process\nreturns a non-zero code or if it generates output to `standard error` (and\nstandard error capturing is enabled, of course).\n\nYou can instruct yacron how to determine if a job has failed or not via the\n``failsWhen`` option:\n\n.. code-block:: yaml\n\n  failsWhen:\n    producesStdout: false\n    producesStderr: true\n    nonzeroReturn: true\n    always: false\n\nproducesStdout\n    If true, any captured standard output causes yacron to consider the job\n    as failed.  This is false by default.\n\nproducesStderr\n    If true, any captured standard error causes yacron to consider the job\n    as failed.  This is true by default.\n\nnonzeroReturn\n    If true, if the job process returns a code other than zero causes yacron\n    to consider the job as failed.  This is true by default.\n\nalways\n    If true, if the job process exits that causes yacron to consider the job as\n    failed.  This is false by default.\n\nIt is possible to instruct yacron to retry failing cron jobs by adding a\n``retry`` option inside ``onFailure``:\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: |\n      echo \"hello\" 1>&2\n      sleep 1\n      exit 10\n    schedule:\n      minute: \"*/10\"\n    captureStderr: true\n    onFailure:\n      report:\n        mail:\n          from: example@foo.com\n          to: example@bar.com\n          smtpHost: 127.0.0.1\n      retry:\n        maximumRetries: 10\n        initialDelay: 1\n        maximumDelay: 30\n        backoffMultiplier: 2\n\nThe above settings tell yacron to retry the job up to 10 times, with the delay\nbetween retries defined by an exponential backoff process: initially 1 second,\ndoubling for every retry up to a maximum of 30 seconds. A value of -1 for\nmaximumRetries will mean yacron will keep retrying forever, this is mostly\nuseful with a schedule of \"@reboot\" to restart a long running process when it\nhas failed.\n\nIf the cron job is expected to fail sometimes, you may wish to report only in\nthe case the cron job ultimately fails after all retries and we give up on it.\nFor that situation, you can use the ``onPermanentFailure`` option:\n\n.. code-block:: yaml\n\n  - name: test-01\n    command: |\n      echo \"hello\" 1>&2\n      sleep 1\n      exit 10\n    schedule:\n      minute: \"*/10\"\n    captureStderr: true\n    onFailure:\n      retry:\n        maximumRetries: 10\n        initialDelay: 1\n        maximumDelay: 30\n        backoffMultiplier: 2\n    onPermanentFailure:\n      report:\n        mail:\n          from: example@foo.com\n          to: example@bar.com\n          smtpHost: 127.0.0.1\n\nConcurrency\n+++++++++++\nSometimes it may happen that a cron job takes so long to execute that when the moment its next scheduled execution is reached a previous instance may still be running.  How yacron handles this situation is controlled by the option ``concurrencyPolicy``, which takes one of the following values:\n\nAllow\n    allows concurrently running jobs (default)\nForbid\n    forbids concurrent runs, skipping next run if previous hasn\u2019t finished yet\nReplace\n    cancels currently running job and replaces it with a new one\n\nExecution timeout\n+++++++++++++++++\n\n(new in version 0.4)\n\nIf you have a cron job that may possibly hang sometimes, you can instruct yacron\nto terminate the process after N seconds if it's still running by then, via the\n``executionTimeout`` option.  For example, the following cron job takes 2\nseconds to complete, yacron will terminate it after 1 second:\n\n.. code-block:: yaml\n\n  - name: test-03\n    command: |\n      echo \"starting...\"\n      sleep 2\n      echo \"all done.\"\n    schedule:\n      minute: \"*\"\n    captureStderr: true\n    executionTimeout: 1  # in seconds\n\nWhen terminating a job, it is always a good idea to give that job process some\ntime to terminate properly.  For example, it may have opened a file, and even if\nyou tell it to shutdown, the process may need a few seconds to flush buffers and\navoid losing data.\n\nOn the other hand, there are times when programs are buggy and simply get stuck,\nrefusing to terminate nicely no matter what.  For this reason, yacron always\nchecks if a process exited some time after being asked to do so. If it hasn't,\nit tries to forcefully kill the process.  The option ``killTimeout`` option\nindicates how many seconds to wait for the process to gracefully terminate\nbefore killing it more forcefully.  In Unix systems, we first send a SIGTERM,\nbut if the process doesn't exit after ``killTimeout`` seconds (30 by default)\nthen we send SIGKILL.  For example, this cron job ignores SIGTERM, and so yacron\nwill send it a SIGKILL after half a second:\n\n.. code-block:: yaml\n\n  - name: test-03\n    command: |\n      trap \"echo '(ignoring SIGTERM)'\" TERM\n      echo \"starting...\"\n      sleep 10\n      echo \"all done.\"\n    schedule:\n      minute: \"*\"\n    captureStderr: true\n    executionTimeout: 1\n    killTimeout: 0.5\n\nChange to another user/group\n++++++++++++++++++++++++++++\n\n(new in version 0.11)\n\nYou can request that Yacron change to another user and/or group for a specific\ncron job.  The field ``user`` indicates the user (uid or userame) under which\nthe subprocess must be executed.  The field ``group`` (gid or group name)\nindicates the group id.  If only ``user`` is given, the group defaults to the\nmain group of that user.  Example:\n\n.. code-block:: yaml\n\n  - name: test-03\n    command: id\n    schedule:\n      minute: \"*\"\n    captureStderr: true\n    user: www-data\n\nNaturally, yacron must be running as root in order to have permissions to\nchange to another user.\n\n\nRemote web/HTTP interface\n+++++++++++++++++++++++++\n\n(new in version 0.10)\n\nIf you wish to remotely control yacron, you can optionally enable an HTTP REST\ninterface, with the following configuration (example):\n\n.. code-block:: yaml\n\n  web:\n    listen:\n       - http://127.0.0.1:8080\n       - unix:///tmp/yacron.sock\n\nNow you have the following options to control it (using HTTPie as example):\n\nGet the version of yacron:\n##########################\n\n.. code-block:: shell\n\n  $ http get http://127.0.0.1:8080/version\n  HTTP/1.1 200 OK\n  Content-Length: 22\n  Content-Type: text/plain; charset=utf-8\n  Date: Sun, 03 Nov 2019 19:48:15 GMT\n  Server: Python/3.7 aiohttp/3.6.2\n\n  0.10.0b3.dev7+g45bc4ce\n\nGet the status of cron jobs:\n############################\n\n.. code-block:: shell\n\n  $ http get http://127.0.0.1:8080/status\n  HTTP/1.1 200 OK\n  Content-Length: 104\n  Content-Type: text/plain; charset=utf-8\n  Date: Sun, 03 Nov 2019 19:44:45 GMT\n  Server: Python/3.7 aiohttp/3.6.2\n\n  test-01: scheduled (in 14 seconds)\n  test-02: scheduled (in 74 seconds)\n  test-03: scheduled (in 14 seconds)\n\nYou may also get status info in json format:\n\n.. code-block:: shell\n\n  $ http get http://127.0.0.1:8080/status Accept:application/json\n  HTTP/1.1 200 OK\n  Content-Length: 206\n  Content-Type: application/json; charset=utf-8\n  Date: Sun, 03 Nov 2019 19:45:53 GMT\n  Server: Python/3.7 aiohttp/3.6.2\n\n  [\n      {\n          \"job\": \"test-01\",\n          \"scheduled_in\": 6.16588,\n          \"status\": \"scheduled\"\n      },\n      {\n          \"job\": \"test-02\",\n          \"scheduled_in\": 6.165787,\n          \"status\": \"scheduled\"\n      },\n      {\n          \"job\": \"test-03\",\n          \"scheduled_in\": 6.165757,\n          \"status\": \"scheduled\"\n      }\n  ]\n\nStart a job right now:\n######################\n\nSometimes it's useful to start a cron job right now, even if it's not\nscheduled to run yet, for example for testing:\n\n.. code-block:: shell\n\n  $ http post http://127.0.0.1:8080/jobs/test-02/start\n  HTTP/1.1 200 OK\n  Content-Length: 0\n  Content-Type: application/octet-stream\n  Date: Sun, 03 Nov 2019 19:50:20 GMT\n  Server: Python/3.7 aiohttp/3.6.2\n\n\nIncludes\n++++++++\n\n(new in version 0.13)\n\nYou may have a use case where it's convenient to have multiple config files,\nand choose at runtime which one to use.  In that case, it might be useful if\nyou can put common definitions (such as defaults for reporting, shell, etc.)\nin a separate file, that is included by the other files.\n\nTo support this use case, it is possible to ask one config file to include\nanother one, via the ``include`` directive.  It takes a list of file names:\nthose files will be parsed as configuration and merged in with this file.\n\nExample, your main config file could be:\n\n.. code-block:: yaml\n\n  include:\n    - _inc.yaml\n\n  jobs:\n\n    - name: my job\n      ...\n\nAnd your included ``_inc.yaml`` file could contain some useful defaults:\n\n\n.. code-block:: yaml\n\n  defaults:\n    shell: /bin/bash\n    onPermanentFailure:\n      report:\n        sentry:\n          ...\n\nCustom logging\n++++++++++++++\n\nIt's possible to provide a custom logging configuration, via the ``logging``\nconfiguration section.  For example, the following configuration displays log lines with\nan embedded timestamp for each message.\n\n.. code-block:: yaml\n\n    logging:\n      # In the format of:\n      # https://docs.python.org/3/library/logging.config.html#dictionary-schema-details\n      version: 1\n      disable_existing_loggers: false\n      formatters:\n        simple:\n          format: '%(asctime)s [%(processName)s/%(threadName)s] %(levelname)s (%(name)s): %(message)s'\n      handlers:\n        console:\n          class: logging.StreamHandler\n          level: DEBUG\n          formatter: simple\n          stream: ext://sys.stdout\n      root:\n        level: INFO\n        handlers:\n          - console\n\nObscure configuration options\n+++++++++++++++++++++++++++++\n\nenabled: true|false (default true)\n##################################\n\n(new in yacron 0.18)\n\nIt is possible to disable a specific cron job by adding a `enabled: false` option.  Jobs\nwith `enabled: false` will simply be skipped, as if they aren't there, apart from\nvalidating the configuration.\n\n.. code-block:: yaml\n\n    jobs:\n      - name: test-01\n        enabled: false  # this cron job will not run until you change this to `true`\n        command: echo \"foobar\"\n        shell: /bin/bash\n        schedule: \"* * * * *\"\n\n\n\n\n=======\nHistory\n=======\n\n0.19.0 (2023-03-11)\n-------------------\n\n* Add ability to configure yacron's own logging (#81 #82 #83, gjcarneiro, bdamian)\n* Add config value for SMTP(validate_certs=False) (David Batley)\n\n0.18.0 (2023-01-01)\n-------------------\n\n* fixes \"Job is always executed immediately on yacron start\" (#67)\n* add an `enabled` option in jobs (#73)\n* give a better error message when no configuration file is provided or exists (#72)\n\n0.17.0 (2022-06-26)\n-------------------\n\n* Support Additional Shell Report Vars (RJ Garcia)\n* Shell reporter: handle long lines truncatation (Hannes Hergeth)\n* exe: undo pyinstaller LD_LIBRARY_PATH changes in subprocesses (#68, Gustavo Carneiro)\n\n\n0.16.0 (2021-12-05)\n-------------------\n\n* make the capture max line length configurable and change the default\n  from 64K to 16M (#56)\n* Add config option to change prefix of subprocess stream lines (#58, eelkeh)\n\n\n0.15.1 (2021-11-19)\n-------------------\n\n* Fix a bug in the --validate option (#57, Leonid Repin)\n\n\n0.15.0 (2021-11-10)\n-------------------\n\n* Allow emails to be html formatted\n* Fix an error when reading cmd output with huge lines (#56)\n\n\n0.14.0 (2021-10-04)\n-------------------\n\n* Sentry: increase the size of messages before getting truncated #54\n* Sentry: allow specifying the environment option #53\n* Minor fixes\n\n\n0.13.1 (2021-08-10)\n-------------------\n\n* unicode fixes for the exe binary version\n\n0.13.0 (2021-06-28)\n\n* Add ability for one config file to include another one #38\n* Add shell command reporting ability (Hannes Hergeth, #50)\n\n\n0.12.2 (2021-05-31)\n-------------------\n\n* constrain ruamel.yaml to version 0.17.4 or below, later versions are buggy\n\n\n0.12.1 (2021-05-30)\n-------------------\n\n* blacklist ruamel.yaml version 0.17.5 in requirements #47\n\n\n0.12.0 (2021-04-22)\n-------------------\n\n* web: don't crash when receiving a web request without Accept header (#45)\n* add env_file configuration option (Alessandro Romani, #43)\n* email: add missing Date header (#39)\n\n\n0.11.2 (2020-11-29)\n-------------------\n\n* Add back a self contained binary, this time based on PyInstaller\n\n0.11.1 (2020-07-29)\n-------------------\n\n* Fix email reporting when multiple recipients given\n\n\n0.11.0 (2020-07-20)\n-------------------\n\n* reporting: add a failure reason line at the top of sentry/email (#36)\n* mail: new tls, startls, username, and password options (#21)\n* allow jobs to run as a different user (#18)\n* Support timezone schedule (#26)\n\n\n0.10.1 (2020-06-02)\n-------------------\n\n* Minor bugfixes\n\n\n0.10.0 (2019-11-03)\n-------------------\n\n* HTTP remote interface, allowing to get job status and start jobs on demand\n* Simple Linux binary including all dependencies (built using PyOxidizer)\n\n0.10.0b2 (2019-10-26)\n---------------------\n\n* Build Linux binary inside Docker Ubuntu 16.04, so that it is compatible with\n  older glibc systems\n\n0.10.0b1 (2019-10-13)\n---------------------\n* Build a standalone Linux binary, using PyOxidizer\n* Switch from raven to sentry-sdk\n\n0.9.0 (2019-04-03)\n------------------\n* Added an option to just check if the yaml file is valid without running the scheduler.\n* Fix missing `body` in the schema for sentry config\n\n\n0.8.1 (2018-10-16)\n------------------\n* Fix a bug handling ``@reboot`` in schedule (#22)\n\n0.8.0 (2018-05-14)\n------------------\n* Sentry: add new ``extra`` and ``level`` options.\n\n\n0.7.0 (2018-03-21)\n------------------\n\n* Added the ``utc`` option and document that times are utc by default (#17);\n* If an email body is empty, skip sending it;\n* Added docker and k8s example.\n\n\n0.6.0 (2017-11-24)\n------------------\n* Add custom Sentry fingerprint support\n* Ability to send job metrics to statsd (thanks bofm)\n* ``always`` flag to consider any cron job that exits to be failed\n  (thanks evanjardineskinner)\n* `maximumRetries` can now be ``-1`` to never stop retrying (evanjardineskinner)\n* ``schedule`` can be the string ``@reboot`` to always run that cron job on startup\n  (evanjardineskinner)\n* ``saveLimit`` can be set to zero (evanjardineskinner)\n\n0.5.0\n------------------\n* Templating support for reports\n* Remove deprecated smtp_host/smtp_port\n\n0.4.3 (2017-09-13)\n------------------\n* Bug fixes\n\n0.4.2 (2017-09-07)\n------------------\n* Bug fixes\n\n0.4.1 (2017-08-03)\n------------------\n\n* More polished handling of configuration errors;\n* Unit tests;\n* Bug fixes.\n\n0.4.0 (2017-07-24)\n------------------\n\n* New option ``executionTimeout``, to terminate jobs that get stuck;\n* If a job doesn't terminate gracefully kill it.  New option ``killTimeout``\n  controls how much time to wait for graceful termination before killing it;\n* Switch parsing to strictyaml, for more user friendly parsing validation error\n  messages.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT license",
    "summary": "A modern Cron replacement that is Docker-friendly",
    "version": "0.19.0",
    "split_keywords": [
        "yacron"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af91398a5f7b6f28d627f3c767358a029bde7ff0d9b87b071baba80e2ef15e18",
                "md5": "efb4e589cae34691c02e3f552bec3733",
                "sha256": "ffde4d769101bc24455860aa8d88c6e4e9e07dc8820b07a9397f47a3bca73d05"
            },
            "downloads": -1,
            "filename": "yacron-0.19.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "efb4e589cae34691c02e3f552bec3733",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 27799,
            "upload_time": "2023-03-11T13:55:03",
            "upload_time_iso_8601": "2023-03-11T13:55:03.093971Z",
            "url": "https://files.pythonhosted.org/packages/af/91/398a5f7b6f28d627f3c767358a029bde7ff0d9b87b071baba80e2ef15e18/yacron-0.19.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d295890428da58784bafd48c260eb351656af3389c506affad225f1c7c19bf5b",
                "md5": "9c9a06741b314e3dd3b4b0b10780f4be",
                "sha256": "666e43affebc61f6c4ccd55cbc719d5f2da99138c0c14b21a40dfd943633dcc0"
            },
            "downloads": -1,
            "filename": "yacron-0.19.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9c9a06741b314e3dd3b4b0b10780f4be",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 51494,
            "upload_time": "2023-03-11T13:55:05",
            "upload_time_iso_8601": "2023-03-11T13:55:05.444544Z",
            "url": "https://files.pythonhosted.org/packages/d2/95/890428da58784bafd48c260eb351656af3389c506affad225f1c7c19bf5b/yacron-0.19.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-11 13:55:05",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "gjcarneiro",
    "github_project": "yacron",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "yacron"
}
        
Elapsed time: 0.16702s