Skip to main content

Library and CLI for working with multiple cron jobs within a single cron table

Project description

PyPI - Python Version GitHub Actions Workflow Status Codecov Report Read the Docs PyPI - Wheel PyPI - Downloads

Library and CLI for working with multiple cron jobs within a single cron table

Example

# The following examples assume you have the following example
# crontab file jobs.tab.  Note that due to the way the examples
# are laid out, they will not run in the order shown below.
#
# jobs.tab contents:
# # [Frequent Job]
# MAILTO=user
# MAILFROM=root
# PATH=/home/user
# SHELL=/bin/sh
# CRON_TZ=/Etc/UTC
# * * * * * echo "This runs frequently"
#
# # [Specific Job]
# MAILTO=""
# MAILFROM="user"
# PATH=/some/specific/dir
# SHELL=/bin/bash
# CRON_TZ=/Etc/Universal
# 1 2 3 4 5 echo "This runs... oddly specifically

# Add a job to the crontab
cronberry add jobs.tab

# Add a specific job to the crontab
cronberry add jobs.tab --title "Specific Job"

# Add a job manually to the crontab
cronberry enter "Manually Added" '5 4 3 2 1 echo "Custom cronjob"'

# You can also pass environment variables
cronberry enter "With Env Vars" '1 1 2 3 5 echo "This uses bash!"' --shell /bin/bash

# Remove a job from the crontab
cronberry remove "Specific Job"

# Clear the current crontab
cronberry clear

# Save the current crontab to a file
cronberry save "saved.tab"

# Get the specific job with the given title, from a diff
cronberry view "Frequent Job"
# Returns:
# * * * * * echo "This runs frequently"

# See the environment variables of a given job as well
cronberry view "Frequect Job" -v
# Returns:
# [Frequent Job]
# MAILTO=user
# MAILFROM=root
# PATH=/home/user
# SHELL=/bin/sh
# CRON_TZ=/Etc/UTC
# * * * * * echo "This runs frequently"

# See all the jobs in crontab (you can also use the -v flag)
cronberry list
# Returns:
# jobs.tab contents:
# * * * * * echo "This runs frequently"
#
# # [Specific Job]
# 1 2 3 4 5 echo "This runs... oddly specifically

# Get all the job titles from the crontab
cronberry jobs
# Returns:
# Frequent Job
# Specific Job

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

cronberry-5.0.0.tar.gz (40.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cronberry-5.0.0-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file cronberry-5.0.0.tar.gz.

File metadata

  • Download URL: cronberry-5.0.0.tar.gz
  • Upload date:
  • Size: 40.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cronberry-5.0.0.tar.gz
Algorithm Hash digest
SHA256 e6d9f67ca648bdf46f3b3f4310e1b995b90921593e50c235ae24fa8e3769f9d9
MD5 bf41c2a04a08f5aeb46ca41a3cc7a248
BLAKE2b-256 752462169867d98c6cd56421470091ff915667900f911b44eecf2746661b3903

See more details on using hashes here.

Provenance

The following attestation bundles were made for cronberry-5.0.0.tar.gz:

Publisher: publish.yml on tekktrik/cronberry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cronberry-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: cronberry-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for cronberry-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1891920ac6ecc6d457a9aa4842e96a85933707f7620255b07d0689aa0e645855
MD5 0432e65c0fc6f1a610d340a3eab3c231
BLAKE2b-256 05cac8afad956b3565c3d2222a8abda34205908ffe02b5f563b88202b2b61551

See more details on using hashes here.

Provenance

The following attestation bundles were made for cronberry-5.0.0-py3-none-any.whl:

Publisher: publish.yml on tekktrik/cronberry

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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