Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dilawar authored Dec 17, 2023
1 parent 33c6430 commit 87c8114
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
[![Build](https://github.com/SubconsciousCompute/cron-with-randomness/actions/workflows/rust.yml/badge.svg)](https://github.com/SubconsciousCompute/cron-with-randomness/actions/workflows/rust.yml)
# cron-with-randomness

Extended cron shorthand to randomly select value from given interval.
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.

In addition to standard expression supported by excellent crate cron, we support
following type of expressions.
Similarly one can pass daily constraints to @weekly.

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

Similarly one can pass daily contraints to @weekly.

- `@weekly{D=1-5}` mean 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 9am
and 12pm.
- `@weekly{H=9-12}` run once per week at any day chosen randomly and between 9am
and 12pm.
- `@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
and 12 pm.

# Examples

Expand Down

0 comments on commit 87c8114

Please sign in to comment.