()
| 334 | } |
| 335 | |
| 336 | func (c Crontab) Exists() bool { |
| 337 | |
| 338 | if c.IsUserCrontab { |
| 339 | cmd := c.buildCrontabCommand("-l") |
| 340 | if _, err := cmd.CombinedOutput(); err != nil { |
| 341 | return false |
| 342 | } |
| 343 | } else { |
| 344 | if _, err := os.Stat(c.Filename); os.IsNotExist(err) { |
| 345 | return false |
| 346 | } |
| 347 | } |
| 348 | |
| 349 | return true |
| 350 | } |
| 351 | |
| 352 | func (c Crontab) load() ([]string, int, error) { |
| 353 |
no test coverage detected