Skip to main content

A python implementation of a cron job scheduler

Project description

Process Boss

Python CI Build PyPI Downloads

A Cron job scheduler implemented in Python

1. Installation

pip install process-boss

2. Usage

Create a configuration file in config.yaml somewhere on disk, then run process boss:

python -m process-boss ~/config.yaml

Example: Run a script on Monday mornings

processes:
  - id: test-job
    cron: "0 7 * * MON" # every Monday at 7:00 AM
    command: "echo 'Hello World!'"

3. Configuration reference

Property Required Default Description
scheduler.maxWorkers No 10 Each process is executed in a thread. This is the maximum number of threads that should be used
scheduler.loop.restartSeconds No 15 Number of seconds to wait before reading the config again and evaluating all processes' cron expressions
scheduler.loop.runOnce No False If set to True, the processes in the config file will only be read and executed once, after that process-boss exits.
logs.enabled No False If set to True, it enables logging of both the scheduler, and each execute process in a separate file. The below two are required to set if enabled.
logs.schedulerLogDir No "" Absolute directory path where the log file of the scheduler can be created per each process. Contains metadata about when a given process will run next, and with what parameters. Eg: /var/log/process-boss/scheduler
logs.processLogDir No "" Absolute directory path where the log file of each process can be created, one per execution. Contains the parameters used before ezecution, and the STDOUT and STDERR output of the process. Eg: /var/log/process-boss/process
processes[].id Yes - Non-empty arbitrary string. Eg: my-process
processes[].cron Yes - Non-empty string, should be a CRON expression. Eg. 0 7 * * MON
processes[].command Yes - Non-empty string, should be an executable command. Eg. python script.py
processes[].runAtStartup No False If set to True, the process will be executed immediately when process-boss starts, instead of waiting for the next CRON match

4. Maintainer documentation

See: docs/README_MAINTAINER.md

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

process_boss-0.0.3.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

process_boss-0.0.3-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page