Library and CLI for working with multiple cron jobs within a single cron table
Project description
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
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
cronberry-4.0.0.post0.tar.gz
(41.1 kB
view details)
Built Distribution
File details
Details for the file cronberry-4.0.0.post0.tar.gz
.
File metadata
- Download URL: cronberry-4.0.0.post0.tar.gz
- Upload date:
- Size: 41.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e44afca9c04fbad9e1c68801416aa32f942bb7d7aa2f6abbea5a4644505ffd85 |
|
MD5 | 13dd2a19be3d40261a62dfb331328e2a |
|
BLAKE2b-256 | 180db371843266352a6de7ede2feb54efca95aa2088af92a7e4576a398833d98 |
File details
Details for the file cronberry-4.0.0.post0-py3-none-any.whl
.
File metadata
- Download URL: cronberry-4.0.0.post0-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5fbb962e8817c3463798a73f47a30decf39c2f6cb36e81ed7aad50dda3f91b5 |
|
MD5 | b21a5b3ab1344ba85387fed82befadeb |
|
BLAKE2b-256 | 89619bc7cd2e425c523763f80a074687bed885e810429ccade2adf702f2e2d77 |