Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

wknight1/cronv

Open more actions menu
 
 

Repository files navigation

cronv

CircleCI

Visualize your cron schedules in crontab

cronv output 1d cronv output 30m

Installation

$ go get github.com/takumakanari/cronv/cronv
$ go build -o ./cronv github.com/takumakanari/cronv/cronv
$ mv ./cronv /usr/local/bin # or anywhere
$ cronv --help

Basic usage

Cronv can parse your crontab from stdin like as follows:

$ crontab -l | cronv -o ./my_cron_schedule.html

You can also specify the duration to analysis job schedules.

In a case like the follows, the job schedules will be analyzed from now to 24 hours later:

$ crontab -l | cronv -o ./my_cron_schedule.html -d 24h

Cronv can parse cron entry written in basic cron format. You can see the basically crontab specofication in https://en.wikipedia.org/wiki/Cron#CRON_expression.

Options

Application Options:
  -o, --output=    path to .html file to output (default: ./crontab.html)
  -d, --duration=  duration to visualize in N{suffix} style. e.g.)
                   1d(day)/1h(hour)/1m(minute) (default: 6h)
      --from-date= start date in the format '2006/01/02' to visualize (default:
                   2017/03/15)
      --from-time= start time in the format '15:04' to visualize (default:
                   19:28)
  -t, --title=     title/label of output (default: cron tasks)
  -w, --width=     Table width of output (default: 100)

Help Options:
  -h, --help       Show this help message

Examples

Analyze crontab for 6 hours (by default) from now, , output html file to default path:

$ crontab -l | cronv

For 1 day from now, output html file to default path:

$ crontab -l | cronv -d 1d

For 12 hours from 21:00, today:

$ crontab -l | cronv -from-time 21:00 -d 12h

For 30 minuts from now, output html file to path/to/output.html:

$ crontab -l | cronv -d 30m -o path/to/output.html

For 2 hours from 2016/12/24 17:30, output html file to path/to/output2.html:

$ crontab -l | cronv -from-date '2016/12/24' -from-time 17:30 -d 2h -o path/to/output2.html

With original title/label:

$ crontab -l | cronv -d 1d -t "crontab@`hostname`"  # title/label of html file will be 'crontab@myhost'

With width to spread output table:

$ crontab -l | cronv -o path/to/output2.html -w 180 # table width be 180% of the screen width (100% by default)

$ crontab -l | cronv -o path/to/output2.html -w 75 # be 75% of the screen width

Development

Using dep.

$ cd /path/to/cronv
$ dep ensure
$ crontab -l | go run cronv/main.go

TODO

  • Add output format/style other than HTML.
  • Filter entries in output HTML file.

Patch

Welcome!

About

A visualizer for CRONTAB

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.