crontab

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// DefaultCrontabFilename represents the default path of crontab file
	DefaultCrontabFilename = "/etc/crontab"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Schedule

type Schedule struct {
	Spec    string
	Command string
}

Schedule represents crontab spec and command

func Parse

func Parse(crontab string) ([]*Schedule, error)

Parse parses crontab file and return a list of Schedule

func (*Schedule) ConvertToSystemdCalendar

func (s *Schedule) ConvertToSystemdCalendar() (string, error)

ConvertToSystemdCalendar converts crontab spec format to Systemd Timer format

crontab:       https://en.wikipedia.org/wiki/Cron
Systemd Timer: https://www.freedesktop.org/software/systemd/man/systemd.time.html

func (*Schedule) NameByRegexp

func (s *Schedule) NameByRegexp(nameRegexp *regexp.Regexp) string

NameByRegexp returns schedule name extracted by the given regexp

func (*Schedule) SHA256Sum

func (s *Schedule) SHA256Sum() string

SHA256Sum generates SHA-256 checksum of schedule

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL