Project

cron_info

0.0
No commit activity in last 3 years
No release in over 3 years
This gem parses a cron string and prints a table of information about it
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 12.2.1
~> 3.7.0
 Project Readme

Cron Info

Build Status

A command-line tool that parses a cron string and expands each field to show the times at which it will run.

Installation

There are two ways to install Cron Info, either straight from RubyGems or from the repository.

Installing from RubyGems

gem install cron_info

Installing from repository

Clone the repository:

git clone https://github.com/SebastianCoetzee/cron_info.git

Change into the directory:

cd cron_info

Build the gem:

gem build cron_info.gemspec

Install the gem (replace x with the version number of the gem):

gem install cron_info-x.x.x.gem

Usage

Run the tool with the following command, which parses a cron string and expands each field to show the times at which it will run:

cron_info "*/15" 0 1,15 "*" 1-5 /usr/bin/find

Output:

minute        0 15 30 45
hour          0
day of month  1 15
month         1 2 3 4 5 6 7 8 9 10 11 12
day of week   1 2 3 4 5
command       /usr/bin/find

The command also supports named months and days:

cron_info "*/15,1,1-5,34-50" 0 1,15 Jan-Apr,Nov Mon,Thu-Sat echo hello

Output:

minute        0 1 2 3 4 5 15 30 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
hour          0
day of month  1 15
month         1 2 3 4 11
day of week   1 4 5 6
command       echo hello

Testing

After cloning the repository as explained above, from the root of the repository, run the following:

gem install bundler

Then install the dependencies:

bundle install

After the dependencies are installed, run the following command to run the test suite:

rspec

License

MIT