MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / Remove

Method Remove

agent-source-code/internal/crontab/crontab.go:96–107  ·  view source on GitHub ↗

Remove removes the PatchMon agent's cron file

()

Source from the content-addressed store, hash-verified

94
95// Remove removes the PatchMon agent's cron file
96func (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
110func (m *Manager) generateCronEntries(updateInterval int, executablePath string) []string {

Callers 6

RunScanWithOptionsMethod · 0.80
SaveCredentialsMethod · 0.80
updateAgentFunction · 0.80
cleanupOldBackupsFunction · 0.80
restartServiceFunction · 0.80
toggleIntegrationFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected