schedule

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorServiceNotFound   = errors.New("service not found")
	ErrorServiceNotRunning = errors.New("service is not running")
)

Generic errors

View Source
var (
	// ScheduledSections are the command that can be scheduled (backup, retention, check)
	ScheduledSections = []string{
		constants.CommandBackup,
		constants.SectionConfigurationRetention,
		constants.CommandCheck,
	}
)

Functions

func Close

func Close()

Close does nothing in systemd

func Init

func Init() error

Init verifies systemd is available on this system

Types

type Config

type Config interface {
	Title() string
	SubTitle() string
	JobDescription() string
	TimerDescription() string
	Schedules() []string
	Permission() string
	WorkingDirectory() string
	Command() string
	Arguments() []string
	Environment() map[string]string
	Nice() int
	Logfile() string
}

Config contains all the information needed to schedule a Job

type Job

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

Job scheduler

func NewJob

func NewJob(config Config) *Job

NewJob instantiates a Job object to schedule jobs

func (*Job) Create

func (j *Job) Create() error

Create a new job

func (*Job) Remove

func (j *Job) Remove() error

Remove a job

func (*Job) Status

func (j *Job) Status() error

Status of a job

func (*Job) Update

func (j *Job) Update() error

Update an existing job

type Permission

type Permission int

Permission is either system or user

const (
	PermissionUser Permission = iota
	PermissionSystem
)

Permission

func (Permission) String

func (p Permission) String() string

Jump to

Keyboard shortcuts

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