]> git.lizzy.rs Git - micro.git/commitdiff
Support month and day names in crontab syntax
authorZachary Yedidia <zyedidia@gmail.com>
Wed, 24 Jun 2020 20:33:22 +0000 (16:33 -0400)
committerZachary Yedidia <zyedidia@gmail.com>
Wed, 24 Jun 2020 20:33:22 +0000 (16:33 -0400)
Ref #1739

internal/config/runtime.go
runtime/syntax/crontab.yaml

index 05c5afcc58912bb0924d7f7d8dfebf01c46d7b04..7bf73aa206e0525741496b88cd50217f0125bb4a 100644 (file)
@@ -2063,7 +2063,7 @@ func runtimeSyntaxCrontabHdr() (*asset, error) {
        return a, nil
 }
 
-var _runtimeSyntaxCrontabYaml = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x54\x4d\x4f\xdb\x40\x10\xbd\xfb\x57\x4c\x4d\x54\xd9\x80\x21\x80\x2a\x84\x5b\x4a\xab\x7e\x48\x3d\x20\x0e\xa0\x2a\x2a\x03\xea\xc6\x3b\xc1\x86\xf5\x6e\xb4\xbb\x26\xb2\x3a\xfd\xef\xd5\xda\xc1\x01\x14\x7a\x6b\xe7\x36\xb3\x6f\xde\x7c\x3d\x7b\x56\x29\xf2\xed\x9c\x72\x28\xac\xd1\x5e\x4c\xa3\x48\x92\xa7\xc2\xe7\x11\x00\x40\x78\xd6\xa2\xa6\x1c\xe2\xe5\xfb\x28\xee\x1e\x4a\x12\x92\x6c\x0e\xf1\xf5\xc6\xce\xe6\xc9\x2e\xf9\x62\x77\x09\x88\xa3\xc8\x36\x8a\x5c\x4f\x00\xb0\x01\x4f\xec\xa2\x24\xf0\x55\x4d\x20\xb4\x04\x29\x3c\xc1\xac\x22\x25\x1d\x08\x4b\x2f\xa4\x74\x80\x95\x2b\x94\x32\x0b\x92\x70\x2f\x54\x43\x6e\x7d\x4a\x16\xec\x99\x3b\xd8\xfa\x94\xba\xd2\x8d\xa7\xc1\x1d\x67\x6f\x8e\xd6\x03\x4b\xd3\xd8\x47\xee\x38\xdb\x3f\x58\x0f\x94\xa2\x05\x33\x83\xda\x68\x5f\x76\xc0\x83\xbd\x17\x4a\x2f\x11\x03\xe3\xde\x3e\x24\xc6\x42\xd8\xbc\xdb\x06\x47\x04\x53\x52\x66\x91\xfe\xb5\xce\x82\xe8\xae\x4f\x3f\x84\x64\x0c\xc6\xc2\x21\x54\x0e\xce\x1b\xbd\x1d\x9c\xc6\x51\x4f\x98\x46\x1d\x4d\x06\xce\x0b\x4f\x35\x69\x1f\xce\x98\x5c\x22\x6e\x8e\xb3\xa3\x6d\xc4\x0c\x71\xf7\x6a\x2b\x45\x74\x5b\xff\x2c\xba\xb3\x99\x8e\x10\xf5\x49\xbc\xec\xa5\x30\xda\x79\xf1\xbf\x5b\xe9\xab\x0f\x5b\x3d\x2f\x49\x29\xf8\xbe\xd2\x55\x06\xfd\xb7\x11\x5f\x5f\x7e\xcc\x7e\x5c\x6d\x21\x1e\xc7\xd1\x00\x3f\x0d\x67\x73\x9d\x90\xc3\xee\xc3\x19\xee\xa8\x5d\x18\x2b\x9f\x65\x23\x4e\x93\x5b\xa1\x79\x46\x53\xae\x85\x65\x31\xb7\x5c\x8b\x96\x6f\x1b\xcd\xb7\x8d\x62\xd1\xdc\xb0\xa3\x39\x9b\xc2\xb3\x36\xf7\x2c\xa9\x48\x11\xa7\x6b\x76\x13\x98\x5c\xa3\xb9\x36\x9a\x7d\x43\xbc\x20\xc9\xbe\x6c\x78\x66\x2b\x76\xc2\x3f\xce\x1a\x6a\x7f\x48\x2c\x4d\x8d\xf1\xdc\x92\xb0\xaa\x65\xa1\x75\x23\x94\x6a\xb9\x93\x9d\x6a\x39\x34\xaf\x5a\x96\xa2\x0a\xc1\x4a\xea\xea\xa6\xf4\x1c\x64\xae\xda\x9e\x71\x18\xf9\x93\xd1\xb2\xf2\x95\xd1\x42\x3d\xcc\xe8\xe6\x54\x54\x42\xe5\x10\x27\x88\xbf\x18\xf1\x37\x23\x26\x8c\x98\x32\xe2\x5b\x46\xbc\x62\xc4\x4b\xfe\xc9\x88\x88\x8c\x38\xe2\x77\xfc\x9e\xaf\xf9\x15\x1f\xf3\x6b\x46\xe4\x34\x8e\x86\x41\xeb\x4e\x8e\xd1\x83\xb2\x9d\x17\x36\x8c\xbd\x11\x0f\x21\xd2\x32\x87\x78\xb4\x0a\x3c\xf9\xd9\xf4\x96\x81\x37\xd2\x84\x8e\x2e\xce\x3e\x9f\xf1\x64\x32\xe1\xaf\xdf\x26\xa7\x5f\xd2\xfc\x24\x8e\xa2\x3f\x01\x00\x00\xff\xff\x27\x7d\x1b\xff\xf3\x04\x00\x00"
+var _runtimeSyntaxCrontabYaml = "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xdc\x54\x5d\x4f\xdc\x3a\x10\x7d\xcf\xaf\x98\x6b\x56\x57\x09\x10\x58\x40\x57\x88\xbd\xa5\xb4\xea\x87\xd4\x07\xc4\x03\xa8\x5a\x95\x01\xd5\xbb\x9e\x25\x01\xc7\x5e\xd9\x0e\xab\xa8\xd3\xff\x5e\x39\x59\x02\x94\x05\xb5\x7d\xec\xbc\xcd\xcc\x99\x13\x1f\x7b\x4e\x66\xa5\xa6\xd0\xcc\x69\x04\x53\x67\x4d\x90\x93\x24\x51\x14\x68\x1a\x46\x09\x00\x40\x6c\x1b\x59\xd1\x08\xc4\xb2\x3f\x10\x6d\xa3\x20\xa9\xc8\x8d\x40\x5c\xae\x6d\xad\x1f\x6d\x53\x98\x6e\x2f\x01\x22\x49\x5c\xad\xc9\x77\x04\x00\x6b\xf0\x28\xce\x0a\x82\x50\x56\x04\xd2\x28\x50\x32\x10\xcc\x4a\xd2\xca\x83\x74\xf4\xcc\x48\x0b\xb8\x4f\xa5\xd6\x76\x41\x0a\x6e\xa5\xae\xc9\xaf\x1e\xc9\x63\xfc\x94\xf6\xb1\x7a\xa4\x2a\x4d\x1d\xa8\x4f\x87\xf9\x7f\x07\xab\x81\x85\xad\xdd\x83\x74\x98\xef\xee\xad\x06\x2a\xd9\x80\x9d\x41\x65\x4d\x28\x5a\xe0\xde\xce\x33\x9f\x5e\x22\x7a\xc6\x9d\x5d\x48\xad\x83\x78\xf3\x7e\x13\x3c\x11\x4c\x48\xdb\x45\xf6\xe2\x77\x16\x44\x37\xdd\xf8\x3e\xa4\x43\xb0\x0e\xf6\xa1\xf4\x70\x5a\x9b\xcd\x98\xd4\x9e\x3a\xc2\x2c\x69\x69\x72\xf0\x41\x06\xaa\xc8\x84\xf8\x8c\xe9\x39\xe2\xfa\x30\x3f\xd8\x44\xcc\x11\xb7\x2f\x36\x32\x44\xbf\xf1\x5b\xd5\xa7\x65\x4e\x11\x27\xe9\xb5\x34\x3c\xa3\x09\x57\xd2\xb1\x9c\x3b\xae\x64\xc3\xd7\xb5\xe1\xeb\x5a\xb3\xac\xaf\xd8\xd3\x9c\xed\x34\xb0\xb1\xb7\xac\x68\x9a\x21\x4e\xb2\x97\x19\x7d\x6d\xb8\xb2\x86\x43\x4d\xbc\x20\xc5\xa1\xa8\x79\xe6\x4a\xf6\x32\x3c\x98\xde\x5a\xcf\x06\x88\xe6\x48\x2c\xf5\x4e\xad\xf1\x41\x46\xb9\x7f\x9d\xde\x4e\x62\xbf\x1e\xa7\x05\x69\x0d\x9f\xef\x0d\x92\x43\x67\x72\x71\x79\xfe\x36\xff\x72\xb1\x81\x78\x28\x92\x1e\x7e\x1c\xf7\xcf\xb7\x8e\x8c\x4b\x14\xf7\xe9\x86\x9a\x85\x75\xca\x3f\xb9\x3a\xf1\x87\x0a\x9f\x3e\x82\xf8\x05\x65\xe2\xf1\xe9\x11\xdf\xa4\x8e\x26\xd6\x06\x6e\x48\x3a\xdd\xb0\x34\xa6\x96\x5a\x37\xdc\x7a\x48\x37\x1c\x05\xe8\x86\x95\x2c\x63\xb1\x54\xa6\xbc\x2a\x02\x47\xcf\xea\xa6\x63\xec\x65\xbf\xb3\x46\x95\xa1\xb4\x46\xea\x3b\x9d\x7e\x4e\xd3\x52\xea\x11\x88\x14\xf1\x1b\x23\x7e\x67\xc4\x94\x11\x33\x46\xfc\x9f\x11\x2f\x18\xf1\x9c\xbf\x32\x22\x22\x23\x0e\xf8\x15\xbf\xe6\x4b\xfe\x87\x0f\xf9\x5f\x46\xe4\x4c\x24\xbd\xd0\xaa\xf5\x56\x72\x67\x53\x1f\xa4\x8b\xb2\xd7\x44\x5f\x22\xa3\x46\x20\x06\xf7\x85\x47\x7f\xce\x2e\x72\x08\x56\xd9\x78\xa2\xb3\x93\xf7\x27\x3c\x1e\x8f\xf9\xe3\xa7\xf1\xf1\x87\x6c\x74\x24\x92\xe4\x47\x00\x00\x00\xff\xff\x0b\x8e\x5a\x12\xc0\x05\x00\x00"
 
 func runtimeSyntaxCrontabYamlBytes() ([]byte, error) {
        return bindataRead(
index c2bd93f25340d5d9549e2d1d25eedbf96daeee27..cebc7cad6a6b002a606fe15fae64023048359cfa 100644 (file)
@@ -14,14 +14,14 @@ rules:
       #              month          0-12 (or names, see below)
       #              day of week    0-7 (0 or 7 is Sun, or use names)
 
-    - statement: "^([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+(.*)$\\n?"
-    - constant: "^([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)\\s+([\\*0-9,\\-\\/]+)"
+    - 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))"
     
       # Shell Values
     - type: "^[A-Z]+\\="
 
       # Months and weekday keywords
-    - type: "\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b"
+    - constant: "\\b(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\\b"
     - constant: "\\b(sun|mon|tue|wed|thu|fri|sat)\\b"
     - type: "\\@(reboot|yearly|annually|monthly|weekly|daily|midnight|hourly)\\b"