From 16d3c9147e2081ed83ee8ab3da81c18b3d72ebbe Mon Sep 17 00:00:00 2001 From: Son Roy Almerol Date: Tue, 19 Nov 2024 14:54:26 -0500 Subject: [PATCH] disable schedule before removing --- internal/store/db.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/store/db.go b/internal/store/db.go index cfc2a95..441ed5f 100644 --- a/internal/store/db.go +++ b/internal/store/db.go @@ -271,6 +271,10 @@ func (store *Store) SetSchedule(job Job) error { fullTimerPath := filepath.Join(TimerBasePath, timerPath) if job.Schedule == "" { + cmd := exec.Command("/usr/bin/systemctl", "disable", "--now", timerPath) + cmd.Env = os.Environ() + _ = cmd.Run() + _ = os.Remove(fullSvcPath) _ = os.Remove(fullTimerPath) } else {