(username, directory string, crontabs []*Crontab)
| 840 | } |
| 841 | |
| 842 | func 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 | |
| 855 | func ReadCrontabFromFile(username, filename string, crontabs []*Crontab) []*Crontab { |
| 856 | if _, err := os.Stat(filename); !strings.HasPrefix(filename, "user:") && os.IsNotExist(err) { |
no test coverage detected