Skip to content

its-lee/crony

Repository files navigation

crony

License: MIT Code style: black Build Status Coverage Status PyUp Status

A simple command line program for reporting on crontab job schedules in a provided datetime interval.

Helpful in the following scenarios:

  • Determining which jobs should have been run during an outage to 'catch up' your system.
  • Forecasting which jobs will run when planning outage/events/other jobs.

Installation

pipx

pipx is recommended to install crony (https://pipxproject.github.io/pipx/installation/).

To install a specific version:

pipx uninstall crony; pipx install "git+https://github.com/Cygnut/crony.git@{version tag here}"

To install directly from master (not advised):

pipx uninstall crony; pipx install "git+https://github.com/Cygnut/crony.git@master"

pip

Alternatively, please use the pip module of python:

To install a specific version:

python3 -m pip install "git+https://github.com/Cygnut/crony.git@{version tag here}"

To install directly from master (not advised):

python3 -m pip install "git+https://github.com/Cygnut/crony.git@master"

Usage

$ crony --help
usage: crony [-h] [--version] [--v | --vv | --vvv] [-b] [-e] [-f | -u] [--include-disabled] [--exclude-header] [--only-command] [--d | --dd]

A simple command line program for reporting on crontab job schedules in a provided datetime interval.

options:
  -h, --help              show this help message and exit
  --version, -V           show program's version number and exit
  --v                     log at the warning level
  --vv                    log at the info level
  --vvv                   log at the debug level
  -b, --begin             the datetime to begin at, defaults to the 
                          current datetime. The preferred format is 
                          (YYYY-MM-DD HH:MM:SS), however - other relative 
                          and absolute formats are permitted
  -e, --end               the datetime to end at, defaults to the
                          current datetime. The preferred format is 
                          (YYYY-MM-DD HH:MM:SS), however - other relative 
                          and absolute formats are permitted
  -f, --file              the path to a crontab to be analysed
  -u, --user              the user whose crontab is to be analysed
  --include-disabled, -i  also include disabled cron jobs
  --exclude-header, -x    exclude the header from the output
  --only-command, -c      only show the command, not the full line
  --d                     output with the level of detail set to: count
  --dd                    output with the level of detail set to: full

The default behaviour is to emit a single line for each enabled job scheduled in the provided interval.

More detail can be increasingly provided with the --d flag:

  • --d: The number of planned executions is included
  • --dd: The specific execution datetimes are included

In addition to reading a crontab for a user or from a file, the command will also read from stdin if possible.

About

A simple CLI program for analysing crontabs.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages