# Schedule Job or Leaderboard Reset every 28 days (cron doesnt allow this)

**URL:** <https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380>\
**Category:** Runtime Framework\
**Tags:** server-framework\
**Created:** [June 20, 2024, 2:17pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380 "2024-06-20T14:17:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BernardoSantos](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@BernardoSantos](https://forum.heroiclabs.com/u/BernardoSantos)\
**Post date:** [June 20, 2024, 2:17pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/1 "2024-06-20T14:17:23Z")

</div>

Is there any way to make a leaderboard reset every 28 days?

Or be able to atleast run a job in the background that runs every 28 days/4weeks?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [June 20, 2024, 2:21pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/2 "2024-06-20T14:21:09Z")

</div>

Hello @BernardoSantos,

The CRON expressions used for leaderboard resets unfortunately do not support “every X days”, the best thing I could recommend is to set the reset for a specific day of the month, for example:

```auto
0 0 1 * *

```

Would reset every 1st of every month.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![BernardoSantos](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@BernardoSantos](https://forum.heroiclabs.com/u/BernardoSantos)\
**Post date:** [June 20, 2024, 2:21pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/3 "2024-06-20T14:21:53Z")

</div>

We really wanted to do it every 4 weeks no matter the month hmmn…

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [June 20, 2024, 2:33pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/4 "2024-06-20T14:33:19Z")

</div>

There’s a workaround which is to have separate tournaments with an end time to 28 days later and to create them programmatically at the end of each cycle (for example in the end hook). However this may need some extra considerations on how the client handles these.

For simplicity It’s likely best if you could compromise to any periodicity supported by the CRON expressions.

---

<div class="post-metadata">

**Author:** ![BernardoSantos](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@BernardoSantos](https://forum.heroiclabs.com/u/BernardoSantos)\
**Post date:** [June 20, 2024, 2:47pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/5 "2024-06-20T14:47:20Z")

</div>

That would work… What exactly are the differences between tournaments and leaderboards besides the scheduling rules?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [June 20, 2024, 2:55pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/6 "2024-06-20T14:55:16Z")

</div>

The other difference besides the extra scheduling rules is that tournaments can optionally require the users to have to `Join` them before submitting scores, but otherwise they’re pretty much a superset of leaderboards.

---

<div class="post-metadata">

**Author:** ![BernardoSantos](https://avatars.discourse-cdn.com/v4/letter/b/a87d85/32.png) [@BernardoSantos](https://forum.heroiclabs.com/u/BernardoSantos)\
**Post date:** [June 20, 2024, 3:05pm UTC](https://forum.heroiclabs.com/t/schedule-job-or-leaderboard-reset-every-28-days-cron-doesnt-allow-this/5380/7 "2024-06-20T15:05:03Z")

</div>

OK, thanks. This might be a solution even if it is a workaround
