Documentation ¶
Overview ¶
Package cron implements Crontab specification as defined in
The Open Group Base Specifications Issue 7, 2018 edition IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html
In addition to the standard, this package also implements the */15 syntax I am thinking about removing this as the step syntax doesn't make that much sense to me but the implementation is only an additional stack so it's ok to stay for now.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlagSet ¶
FlagSet is a cron FlagSet
func NewFlagSet ¶
func NewFlagSet(name string, errorhandling flag.ErrorHandling) *FlagSet
NewFlagSet returns a new cron flagset
func (*FlagSet) CronTab ¶
CronTab prints a very nice explanatinon of what things do
Example ¶
fset := NewFlagSet("test", flag.PanicOnError) fset.Parse(strings.Fields("*/15 0 1,15 * 1-5 /usr/bin/find")...) fmt.Println(fset.CronTab())
Output: ┌───────────────────minutes [0s 15m0s 30m0s 45m0s] │ ┌──────────────hours [0s] │ │ ┌────────────days of the month [1 15] │ │ │ ┌───────months [January February March April May June July August September October November December] │ │ │ │ ┌─────days of the week [Monday Tuesday Wednesday Thursday Friday] │ │ │ │ │ ┌─args [/usr/bin/find] */15 0 1,15 * 1-5 /usr/bin/find
Click to show internal directories.
Click to hide internal directories.