goat

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2020 License: MIT Imports: 7 Imported by: 1

README

goat

GoDoc Go Report Card

Golang connector for at(1).

Schedule external command executions, powered by the at(1)-utility:

// let /hello/world.sh be run at <execTime>
execTime := time.Date(<in the future>)
jobID, err := at.AddJob("/hello/world.sh", execTime)

// changed your mind?
at.RemoveJob(jobID)
Prerequisites

at(1) must be present on your system. If it's not, try apt install at or yum install at or pacman -S at or apk add at according to your linux flavor.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddJob

func AddJob(command string, atTime time.Time, toQueue ...string) (int, error)

AddJob adds a command to an at(1) execution queue. It will be run at atTime. Optionally, the job can be written to specific queue toQueue, default is "a". Queues must be adressed by a single letter.

func ClearQueue

func ClearQueue(queueLetter ...string) error

ClearQueue removes all jobs from the at queue specified by queueLetter. If no queueLetter is given, clears default queue "a".

func RemoveJob

func RemoveJob(jobID int) error

RemoveJob removes the job specified by jobID from the at(1) execution queues.

Types

This section is empty.

Jump to

Keyboard shortcuts

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