crontab.in
monitor with cron.watch
go scheduling

Scheduling in Go.

The de-facto cron library for Go uses standard 5-field expressions by default. Here is the idiomatic setup, plus when a plain Ticker is enough.

robfig/cron (v3)

The standard choice. By default it parses 5-field Unix cron (no seconds) and also understands @every and @daily shortcuts:

import "github.com/robfig/cron/v3"

c := cron.New()                       // 5-field, server local time

// every weekday at 09:00  ==  0 9 * * 1-5
c.AddFunc("0 9 * * 1-5", func() { report() })
c.AddFunc("@every 15m",   func() { poll() })

c.Start()
select {}                             // block forever

Need seconds or a timezone? Configure the parser:

loc, _ := time.LoadLocation("UTC")
c := cron.New(cron.WithSeconds(), cron.WithLocation(loc))
c.AddFunc("0 0 9 * * 1-5", report)   // 6-field: sec min hour dom mon dow

time.Ticker (simple intervals)

If all you need is "every N", the standard library is enough — no dependency:

ticker := time.NewTicker(15 * time.Minute)
defer ticker.Stop()
for range ticker.C {
    poll()
}

Monitor it free with cron.watch

A goroutine that panics or a container that gets OOM-killed stops your schedule with no warning. A schedule is only a promisecron.watch tells you if the job actually ran, alerts you when it silently fails, skips, or runs long, and keeps a history of every run.

import "net/http"

func report() {
    defer http.Get("https://cron.watch/s/your-id") // ping after the run
    doWork()
}
Get cron.watch free ↗ Analyze your crontab →

More scheduling guides