Timetable for your cronjobs
Project description
Cron-times is the timetable for your cronjobs. It shows you when your cronjobs are running, in a human-friendly way.
Quick start
Install from PyPI:
pip install cron-times
Run:
flask --app cron_times init-db
flask --app cron_times run
The app will be available at http://localhost:5000
Add cronjobs
You can describe your cronjobs in TOML format:
# Always starts with [[job]]
# You can add multiple jobs in one file
[[job]]
# unique key within the group for each job
# this field is invisible to users and only used for internal reference
# if not set, it will use job name as the key
key = "custom-key-01"
# [required] job name
name = "Sample job"
# [required] cronjob schedule, in crontab format
schedule = "0 10/3 * * *"
# timezone, default to UTC
timezone = "Asia/Taipei"
# job description
description = """
In the description, you *can* use `markdown`
"""
# flag to indicate if the job is enabled
enabled = true
# labels
labels = [
"foo",
]
# metadata
# you can use this field to store any extra information
[job.metadata]
"extra field" = "can be anything"
pi = 3.14
"reference url" = "https://example.com"
After the TOML file is ready, you can import it with the following command:
flask --app cron_times read-file /path/to/jobs.toml
Built-in job adapters
Cron-times comes with some built-in job adapters. You can use them by running the following commands and it will read the job list from the specified location.
dbt cloud
Reads schedule job list from dbt cloud:
flask --app cron_times read-dbt-cloud --help
Argo workflow
Reads Cron Workflows from Argo Workflows:
flask --app cron_times read-argo-workflow --help
Configuration
Cron-times uses Flask as the web framework, and adapts Flask’s configuration system.
Set the environment variable to the path of that file:
export CRON_TIMES_SETTINGS=/path/to/settings.cfg
You can set the following options:
# Site name to be used for the page title
SITE_NAME="My cronjobs"
# Time range to show in the timetable based on current time, in seconds
TIMETABLE_LOOKBEHIND_SECONDS=86400 # 1day
TIMETABLE_LOOKAHEAD_SECONDS=172800 # 2days
# Max number of items to show in the timetable
# If there are more items than this number, it would only return the jobs that is closest to the current time
# Note that the more items you show, the slower the page will be loaded
TIMETABLE_MAX_ITEMS=512
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cron_times-0.9.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f816d400aa47605d87a7d61665fb87f49a88629da1ce85aae973e73d91743e69 |
|
MD5 | 8e38ac237e4c287ca09ae922291f9f5d |
|
BLAKE2b-256 | 39263a6cbc2ba1b020af3b50684562305b8a264c8547726c4725f37b16267df6 |