Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dilawar authored Sep 18, 2024
1 parent 361e6b5 commit 7441ae0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
Extended cron shorthand to randomly select value from given interval. In addition to standard expression
supported by crate cron, this crate supports following shorthands.

- `@daily{H=9-17}` means run once between 9 am and 5 pm chosen randomly.
- `@daily{H=9-12,H=15-20}` means run once between 9 am and 12 pm or between 3 pm and 8 pm.
- `@daily{h=9-17}` means run once between 9 am and 5 pm chosen randomly.
- `@daily{h=9-12,h=15-20}` means run once between 9 am and 12 pm or between 3 pm and 8 pm.

Similarly one can pass daily constraints to @weekly.

- `@weekly{D=1-5}` means run once per week between day 1 and day 5.
- `@weekly{D=1-5,H=9-12}` run once per week between day 1 and day 5 and between 9 am
- `@weekly{d=1-5}` means run once per week between day 1 and day 5.
- `@weekly{d=1-5,h=9-12}` run once per week between day 1 and day 5 and between 9 am
and 12 pm.
- `@weekly{H=9-12}` runs once per week on any day chosen randomly and between 9 am
- `@weekly{h=9-12}` runs once per week on any day chosen randomly and between 9 am
and 12 pm.

# Examples

## `@daily`

```
$ cargo run -- @daily{9-17}
$ cargo run -- @daily{h=9-17}
--> 2023-12-18T13:17:00Z
--> 2023-12-19T09:52:00Z
Expand Down

0 comments on commit 7441ae0

Please sign in to comment.