crond

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crontab

type Crontab struct {
	// contains filtered or unexported fields
}

func NewCrontab

func NewCrontab(entries []Entry) *Crontab

func (*Crontab) Generate

func (c *Crontab) Generate(w io.StringWriter) error

func (*Crontab) LoadCurrent

func (c *Crontab) LoadCurrent() (string, error)

func (*Crontab) Remove

func (c *Crontab) Remove() (int, error)

func (*Crontab) Rewrite

func (c *Crontab) Rewrite() error

func (*Crontab) Update

func (c *Crontab) Update(source string, addEntries bool, w io.StringWriter) (int, error)

Update crontab entries:

If addEntries is set to true, it will delete and add all new entries

If addEntries is set to false, it will only delete the matching entries

Return values are the number of entries deleted, and an error if any

type Entry

type Entry struct {
	// contains filtered or unexported fields
}

Entry represents a new line in the crontab

func NewEntry

func NewEntry(event *calendar.Event, configFile, profileName, commandName, commandLine, workDir string) Entry

NewEntry creates a new crontab entry

func (Entry) Generate

func (e Entry) Generate(w io.StringWriter) error

Generate writes a cron line in the StringWriter (end of line included)

func (Entry) String

func (e Entry) String() string

String returns the crontab line representation of the entry (end of line included)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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