1
0
mirror of https://github.com/PerMalmberg/libcron.git synced 2025-10-18 05:45:20 -05:00

Added "convenience scheduling" using @yearly, @annually, @monthly, @weekly, @daily or @hourly. (#24)

This commit is contained in:
Peter Jansson
2021-12-20 08:16:36 +01:00
committed by GitHub
parent d4679b7c3c
commit a3b892a24a
2 changed files with 23 additions and 2 deletions

View File

@@ -183,6 +183,17 @@ Each part is separated by one or more whitespaces. It is thus important to keep
`Day of month` and `day of week` are mutually exclusive so one of them must at always be ignored using
the '?'-character to ensure that it is not possible to specify a statement which results in an impossible mix of these fields.
## Convenience scheduling
These special time specification "nicknames" which replace the 5 initial time and date fields, and are prefixed with the '@' character, are supported:
@yearly : Run once a year, ie. "0 0 1 1 *".
@annually : Run once a year, ie. "0 0 1 1 *".
@monthly : Run once a month, ie. "0 0 1 * *".
@weekly : Run once a week, ie. "0 0 * * 0".
@daily : Run once a day, ie. "0 0 * * *".
@hourly : Run once an hour, ie. "0 * * * *".
## Examples
|Expression | Meaning
@@ -191,6 +202,7 @@ the '?'-character to ensure that it is not possible to specify a statement which
| 0 0 12 * * MON-FRI | Every Weekday at noon
| 0 0 12 1/2 * ? | Every 2 days, starting on the 1st at noon
| 0 0 */12 ? * * | Every twelve hours
| @hourly | Every hour
# Randomization