Documentation
¶
Index ¶
- Variables
- type Crontab
- func (c *Crontab) GetEntries() ([]Entry, error)
- func (c *Crontab) LoadCurrent() (content string, err error)
- func (c *Crontab) Remove() (int, error)
- func (c *Crontab) Rewrite() error
- func (c *Crontab) SetBinary(crontabBinary string) *Crontab
- func (c *Crontab) SetFile(file string) *Crontab
- func (c *Crontab) SetFs(fs afero.Fs) *Crontab
- type Entry
- func (e Entry) CommandLine() string
- func (e Entry) CommandName() string
- func (e Entry) ConfigFile() string
- func (e Entry) Event() *calendar.Event
- func (e Entry) Generate(w io.StringWriter) error
- func (e Entry) HasUser() bool
- func (e Entry) NeedsUser() bool
- func (e Entry) ProfileName() string
- func (e Entry) SkipUser() bool
- func (e Entry) String() string
- func (e Entry) User() string
- func (e Entry) WithUser(user string) Entry
- func (e Entry) WorkDir() string
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrEntryNoMatch = errors.New("line doesn't match a typical resticprofile entry")
)
View Source
var (
ErrNoCrontabFile = errors.New("no crontab file was specified")
)
Functions ¶
This section is empty.
Types ¶
type Crontab ¶
type Crontab struct {
// contains filtered or unexported fields
}
func NewCrontab ¶
func (*Crontab) GetEntries ¶ added in v0.30.0
func (*Crontab) LoadCurrent ¶
func (*Crontab) SetBinary ¶ added in v0.27.0
SetBinary sets the crontab binary to use for reading and writing the crontab (if empty, SetFile must be used)
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) CommandLine ¶ added in v0.30.0
func (Entry) CommandName ¶ added in v0.30.0
func (Entry) ConfigFile ¶ added in v0.30.0
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) ProfileName ¶ added in v0.30.0
func (Entry) String ¶
String returns the crontab line representation of the entry (end of line included)
Click to show internal directories.
Click to hide internal directories.