Remove removes the PatchMon agent's cron file
()
| 94 | |
| 95 | // Remove removes the PatchMon agent's cron file |
| 96 | func (m *Manager) Remove() error { |
| 97 | if err := os.Remove(config.CronFilePath); err != nil { |
| 98 | if errors.Is(err, fs.ErrNotExist) { |
| 99 | // File doesn't exist, which is fine |
| 100 | return nil |
| 101 | } |
| 102 | return fmt.Errorf("failed to remove cron file: %w", err) |
| 103 | } |
| 104 | |
| 105 | m.logger.WithField("path", config.CronFilePath).Info("Removed cron file") |
| 106 | return nil |
| 107 | } |
| 108 | |
| 109 | // generateCronEntries generates cron entries for both report and update-crontab commands |
| 110 | func (m *Manager) generateCronEntries(updateInterval int, executablePath string) []string { |
no outgoing calls
no test coverage detected