Documentation
¶
Overview ¶
Package cron provides cron expression parsing, matching, and crontab file parsing for the memsh virtual shell scheduler, backed by robfig/cron/v3.
Index ¶
Constants ¶
const CronLogFile = "/.cron_log"
CronLogFile is the virtual-FS path where cron job output is appended.
const CrontabFile = "/.crontab"
CrontabFile is the virtual-FS path where the user's crontab is stored.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CronExpr ¶
CronExpr is a parsed cron schedule. It is a type alias for robfig.Schedule so callers that already hold a CronExpr can pass it directly to CronMatches without any conversion.
func ParseCronExpr ¶
ParseCronExpr parses a cron expression string into a CronExpr (Schedule). Both 5-field ("m h dom mon dow") and @special forms are accepted. The day-of-week value 7 (Sunday alias used by many cron implementations) is normalised to 0 before passing to the parser, since robfig/cron/v3 only accepts 0–6 in that field.
type CronJob ¶
CronJob is one entry parsed from a crontab file.
func ParseCrontab ¶
ParseCrontab parses the content of a crontab file into a slice of CronJobs. Blank lines and lines beginning with '#' are ignored. Each non-comment line must be either:
@special command... (e.g. "@daily /backup.sh") m h dom mon dow command... (standard 5-field form)