2017-06-10 19:24:46 +00:00
|
|
|
filetype: crontab
|
|
|
|
|
|
|
|
|
|
detect:
|
2024-04-01 17:50:42 +00:00
|
|
|
filename: "crontab$|/tmp/crontab\\.\\w+$"
|
2024-03-23 20:44:27 +00:00
|
|
|
header: "^#.*?/etc/crontab"
|
2017-06-10 19:24:46 +00:00
|
|
|
|
|
|
|
|
rules:
|
|
|
|
|
# The time and date fields are:
|
|
|
|
|
# field allowed values
|
|
|
|
|
# ----- --------------
|
|
|
|
|
# minute 0-59
|
|
|
|
|
# hour 0-23
|
|
|
|
|
# day of month 0-31
|
|
|
|
|
# month 0-12 (or names, see below)
|
|
|
|
|
# day of week 0-7 (0 or 7 is Sun, or use names)
|
|
|
|
|
|
2020-06-24 20:33:22 +00:00
|
|
|
- statement: "^([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+(([\\*0-9,\\-\\/]+)|(\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b))\\s+(([\\*0-9,\\-\\/]+)|(\\b(sun|mon|tue|wed|thu|fri|sat)\\b))\\s+(.*)$\\n?"
|
|
|
|
|
- constant: "^([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+(([\\*0-9,\\-\\/]+)|(\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b))\\s+(([\\*0-9,\\-\\/]+)|(\\b(sun|mon|tue|wed|thu|fri|sat)\\b))"
|
2024-03-22 16:56:09 +00:00
|
|
|
|
2017-06-10 19:24:46 +00:00
|
|
|
# Shell Values
|
|
|
|
|
- type: "^[A-Z]+\\="
|
|
|
|
|
|
|
|
|
|
# Months and weekday keywords
|
2020-06-24 20:33:22 +00:00
|
|
|
- constant: "\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b"
|
2020-06-24 20:00:56 +00:00
|
|
|
- constant: "\\b(sun|mon|tue|wed|thu|fri|sat)\\b"
|
|
|
|
|
- type: "\\@(reboot|yearly|annually|monthly|weekly|daily|midnight|hourly)\\b"
|
2017-06-10 19:24:46 +00:00
|
|
|
|
|
|
|
|
# Conditionals
|
|
|
|
|
- special: "(\\{|\\}|\\(|\\)|\\;|\\]|\\[|`|\\\\|\\$|<|>|^|!|=|&|\\|)"
|
|
|
|
|
|
|
|
|
|
- comment:
|
|
|
|
|
start: "#"
|
|
|
|
|
end: "$"
|
|
|
|
|
rules:
|
|
|
|
|
- todo: "(TODO|XXX|FIXME):?"
|
|
|
|
|
|