saltstack / saltstack/salt

[FEATURE REQUEST] random/N for salt.states.cron

Open
#60,567 5 comments 0 reactions 1 assignee View on GitHub

@dwoz is already working on this.

Since Jul 19, 2021.

Feature pending-discussion
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Describe the solution you'd like
salt.states.cron currently supports values like minute: '*/5' to run every 5 minutes. If I understand correctly, that runs on minutes 0, 5, 10, etc., right? There's also support for minute: 'random' to run on a random minute. It would be nice to have the combination of those two features so something like minute: 'random/5' would run every 5 minutes, starting on a random minute between 0 and 4.

Describe alternatives you've considered
I'm not aware of any other easy way to spread out cron jobs that run every N minutes/hours/etc. It is possible for a cron job to sleep for a random amount of time before doing anything else though.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.