MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / ReadCrontabFromFile

Function ReadCrontabFromFile

lib/crontab.go:855–864  ·  view source on GitHub ↗
(username, filename string, crontabs []*Crontab)

Source from the content-addressed store, hash-verified

853}
854
855func ReadCrontabFromFile(username, filename string, crontabs []*Crontab) []*Crontab {
856 if _, err := os.Stat(filename); !strings.HasPrefix(filename, "user:") && os.IsNotExist(err) {
857 return crontabs
858 }
859
860 crontab := CrontabFactory(username, filename)
861 crontab.Parse(true)
862 crontabs = append(crontabs, crontab)
863 return crontabs
864}
865
866// GetAllCrontabs returns a slice of all available Crontab objects.
867func GetAllCrontabs(users []string) ([]*Crontab, error) {

Callers 3

gatherCrontabsFunction · 0.92
GetAllCrontabsFunction · 0.85
GetCrontabFunction · 0.85

Calls 2

CrontabFactoryFunction · 0.85
ParseMethod · 0.80

Tested by

no test coverage detected