Search code examples
cron

How to get a cronjob to execute 3 days, and 2 days break?


I want a script to execute 3 days in a row, and then 2 days not, and then 3 days again. I think this does it, but I'm not sure.

00 22 1-31/5,2-31/5,3-31/5 * *

How the first 10 days (2 loop) would look:

01/01/2021 On

01/02/2021 On

01/03/2021 On

01/04/2021 Off

01/05/2021 Off

01/06/2021 On

01/07/2021 On

01/08/2021 On

01/09/2021 Off

01/10/2021 Off


Solution

  • Yes this works like I intended. A loop of [3:2] days.