crond

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: GPL-3.0 Imports: 10 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) (c *Crontab)

func (*Crontab) Generate

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

func (*Crontab) LoadCurrent

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

func (*Crontab) Remove

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

func (*Crontab) Rewrite

func (c *Crontab) Rewrite() error

func (*Crontab) SetBinary added in v0.27.0

func (c *Crontab) SetBinary(crontabBinary string)

SetBinary sets the crontab binary to use for reading and writing the crontab (if empty, SetFile must be used)

func (*Crontab) SetFile added in v0.27.0

func (c *Crontab) SetFile(file string)

SetFile toggles whether to read & write a crontab file instead of using the crontab binary

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) HasUser added in v0.27.0

func (e Entry) HasUser() bool

func (Entry) NeedsUser added in v0.27.0

func (e Entry) NeedsUser() bool

func (Entry) SkipUser added in v0.27.0

func (e Entry) SkipUser() bool

func (Entry) String

func (e Entry) String() string

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

func (Entry) WithUser added in v0.27.0

func (e Entry) WithUser(user string) Entry

WithUser creates a new entry that adds a user that should run the command

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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