Specifications
OCPS 1.1: Predefined Schedules
Status: FINAL
Revision: 1
Date: 2026-11-26
1. Introduction #
This document defines version 1.1 of the Open Cron Pattern Specification (OCPS). It is a backward-compatible superset of OCPS 1.0 that adds predefined schedules ("nicknames") such as @daily. Its primary goal is to standardize this long-standing de facto Vixie / ISC cron feature.
2. Design Rationale #
OCPS 1.1 retains the OCPS 1.0 design: a stable foundation codifying the Vixie/ISC cron dialect with explicit rules for ambiguous edge cases. Predefined schedules have been a feature of Vixie cron and its derivatives for many years. OCPS 1.1 formalizes the most common set of nicknames so they are portable and predictable, including the event-based @reboot, which is included due to its historical prevalence. By defining its special handling (valid at parse-time, potentially rejected at run-time), the specification acknowledges that not all environments can support it while maintaining syntactic consistency.
3. Conformance #
An implementation is considered "OCPS 1.1 Compliant" if it meets all OCPS 1.0 requirements and correctly implements the predefined schedules defined in Section 7. Any pattern valid in OCPS 1.1 MUST remain valid and produce an identical schedule in all future versions of the specification.
4. Pattern Format #
4.1. Structure #
An OCPS 1.1 pattern MUST be either a nickname as defined in Section 7 or consist of five fields separated by whitespace. A compliant parser MUST adhere to the following rules:
- A five-field pattern MUST be rejected if it contains any characters not explicitly allowed by Section 4.3, by raising a clear parsing error.
- Any leading or trailing whitespace from the entire string MUST be ignored.
- One or more consecutive whitespace characters MUST be treated as a single delimiter.
MINUTE HOUR DAY-OF-MONTH MONTH DAY-OF-WEEK
4.2. Field Values #
| Field | Required | Allowed Values |
|---|---|---|
| Minute | Yes | 0-59 |
| Hour | Yes | 0-23 |
| Day of Month | Yes | 1-31 |
| Month | Yes | 1-12 or JAN-DEC |
| Day of Week | Yes | 0-7 or SUN-SAT |
- Month and Day of Week names MUST be treated as case-insensitive.
- In the Day of Week field,
0and7MUST both be treated as Sunday.
Month Name Equivalents #
| Name | Numeric Value |
|---|---|
| JAN | 1 |
| FEB | 2 |
| MAR | 3 |
| APR | 4 |
| MAY | 5 |
| JUN | 6 |
| JUL | 7 |
| AUG | 8 |
| SEP | 9 |
| OCT | 10 |
| NOV | 11 |
| DEC | 12 |
Day of Week Name Equivalents #
| Name | Numeric Value |
|---|---|
| SUN | 0 or 7 |
| MON | 1 |
| TUE | 2 |
| WED | 3 |
| THU | 4 |
| FRI | 5 |
| SAT | 6 |
4.3. Character Set #
After converting any textual representations (e.g., JAN, SUN) to their numeric equivalents, a five-field pattern MUST only contain characters from the following set:
- Whitespace: Space (
U+0020) or horizontal tab (U+0009). - Digits:
0123456789 - Special Characters:
*,-/
5. Special Characters #
| Character | Name | Example | Description |
|---|---|---|---|
* | Wildcard | * * * * * | Matches every allowed value for the field. |
, | List Separator | 0,15,30,45 | Specifies a list of individual values. |
- | Range | 9-17 | Specifies an inclusive range of values. |
/ | Step | 5-59/15 | Specifies an interval. The step operates on the range it modifies, yielding 5,20,35,50 for this example. |
5.1. Combining Special Characters #
In OCPS 1.1, the special characters are combined within a single field to create complex schedules. The combination follows a specific order of operations.
- List Separation (
,): The comma is the top-level separator. It breaks a field into a list of independent sub-expressions. The final set of values for the field is the union (logicalOR) of the results of each sub-expression. A parser MUST parse and validate every sub-expression in the list, even if an earlier sub-expression already yields the full possible range for the field. - Range (
-) or Wildcard (*): Within each sub-expression, a range (10-20) or a wildcard (*) defines the initial set of numbers. A wildcard is equivalent to the full possible range for that field (e.g.,0-59for minutes). Accordingly, an unrestricted wildcard MAY appear as one entry within a list (e.g.,*,1-30), and if all other entries are valid the resulting set for the field is still the full possible range. - Step (
/): The step is an operator that filters the set generated by a range or wildcard. The resulting set includes the lowest value of the range, plus every N-th value after that (where N is the step value) which also falls within the range.
6. Operational Semantics #
6.1. Logical Combination of Day of Month and Day of Week #
When both the Day of Month and Day of Week fields are restricted, a match occurs if either field matches the current date. This is a logical OR.
For this rule, a field is unrestricted only when its first list sub-expression is *. Any other form is restricted, even if it evaluates to the full field range (e.g., 1-31 in the day-of-month field). This preserves Vixie-compatible day-field behavior while still allowing * inside lists (e.g., *,1 is unrestricted).
- Example: The pattern
0 12 1 * MONwill trigger at noon on the first day of every month, AND at noon on every Monday.
6.2. Error Handling and Edge Cases #
Out-of-Range Values #
A parser MUST reject a pattern if any numeric value falls outside the allowed range for its field (e.g., 60 in the minute field, 32 in the day-of-month field). This MUST be treated as a parsing error. This requirement applies to every list sub-expression independently; for example, *,*,61 in the minute field is a parsing error even though * already covers the full range.
Invalid Ranges #
A range A-B where A is greater than B is invalid. A parser MUST treat this as a parsing error.
Invalid Step Syntax #
A parser MUST reject the following step-related patterns as parsing errors:
- A step value of
0(e.g.,*/0), as it has no logical definition. - A step operator not preceded by
*or a full rangeA-B(e.g.,/30,0/15, or10/10). The/character MUST be preceded by either*or a range in the formA-Bwhere both A and B are specified (e.g.,*/30or10-50/10are valid, but/30,0/15, or10/10are not).
Impossible Date Combinations #
A pattern containing a valid but impossible date (e.g., * * 31 2 * for February 31st) MUST be considered syntactically valid and MUST NOT cause a parsing error.
Implementations that provide iterators to find the next or previous occurrences of a schedule (e.g., findNextRun()) SHOULD throw a runtime error or otherwise indicate that no valid run time can ever be found for such a pattern.
6.3. Implementation-Specific Configurations #
To allow for flexibility while maintaining a stable standard, the following rules apply to implementation-specific configurations:
- An implementation MAY provide configuration options that alter the default behaviors defined in this specification.
- Compliance with this specification MUST be evaluated based on the implementation's default, unconfigured behavior.
6.4. Time Zone Handling #
OCPS 1.1 patterns are timezone-agnostic.
A compliant parser or scheduler MUST interpret the pattern against the implementation's local time. The mechanism for defining this local time is an implementation detail, as per Section 6.3.
7. Predefined Schedules ("Nicknames") #
7.1. Nicknames #
OCPS 1.1 adds support for nicknames as aliases for common patterns. Nicknames MUST be treated as case-sensitive. Leading and trailing whitespace around a nickname MUST be ignored, as in Section 4.1. An implementation MUST recognize the following strings, which MUST NOT be combined with a 5-field expression or any other token. The equivalent patterns are normative.
| Nickname | Equivalent 5-Field Pattern | Description |
|---|---|---|
@yearly / @annually | 0 0 1 1 * | On January 1st at midnight. |
@monthly | 0 0 1 * * | On the first day of the month at midnight. |
@weekly | 0 0 * * 0 | Every Sunday at midnight. |
@daily / @midnight | 0 0 * * * | Every day at midnight. |
@hourly | 0 * * * * | At the start of every hour. |
@reboot | N/A | Run once at startup. |
Because the equivalent patterns are ordinary OCPS 1.0 patterns, the day-field semantics of Section 6.1 apply to them unchanged.
7.2. Special Handling for @reboot #
The @reboot nickname is a special case, as it is not time-based but event-based. It has no 5-field equivalent, so Sections 6.1 and 6.2 do not apply to it.
- An OCPS 1.1 compliant parser MUST recognize
@rebootas a valid pattern. - If an implementation's execution environment does not support a "startup" or "reboot" event (for example, a browser or a serverless environment), the implementation MAY reject the pattern at runtime. If rejected, it SHOULD provide a clear error message stating that
@rebootis unsupported in the current context. It MUST NOT be treated as a syntax error during parsing.
Appendix A: Revision History #
| Revision | Date | Author(s) | Description of Changes |
|---|---|---|---|
| 1 | 2026-11-26 | The OCPS Authors | Initial publication of the 1.1 specification. Includes OCPS 1.0 revision 3. Adds predefined schedules (nicknames); clarifies five-field character restrictions and nickname whitespace handling. |