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

Function ReadCrontabsInDirectory

lib/crontab.go:842–853  ·  view source on GitHub ↗
(username, directory string, crontabs []*Crontab)

Source from the content-addressed store, hash-verified

840}
841
842func ReadCrontabsInDirectory(username, directory string, crontabs []*Crontab) []*Crontab {
843 files := EnumerateFiles(directory)
844 if len(files) > 0 {
845 for _, crontabFile := range files {
846 crontab := CrontabFactory(username, crontabFile)
847 crontab.Parse(true)
848 crontabs = append(crontabs, crontab)
849 }
850 }
851
852 return crontabs
853}
854
855func ReadCrontabFromFile(username, filename string, crontabs []*Crontab) []*Crontab {
856 if _, err := os.Stat(filename); !strings.HasPrefix(filename, "user:") && os.IsNotExist(err) {

Callers 2

gatherCrontabsFunction · 0.92
GetAllCrontabsFunction · 0.85

Calls 3

EnumerateFilesFunction · 0.85
CrontabFactoryFunction · 0.85
ParseMethod · 0.80

Tested by

no test coverage detected