[Remind-Fans] Would love some help

Tim Chase remind at tim.thechases.com
Thu Mar 17 09:06:29 EDT 2022


[sorry if a dupe hits the list; I sent from the wrong address
initially]

On 2022-03-17 08:34, Dianne Skoll via Remind-fans wrote:
> > I have monthly reminds to update each of my hypervisors one day at
> > the time. I have omitted weekends and finnish holidays. It works
> > fine BUT they will stack for the next available workday and I
> > want them to spread for the rest of the week, one reminder per
> > day.  
> 
> If you are using version 3.3.10 or newer of Remind, you can make the
> reminders pose as holidays with the ADDOMIT keyword.  

If you're not using a more recent version, or you think about it in a
different way, here's my take using nonomitted():

  PUSH
    OMIT Jan 12 2022 MSG Random Holiday
    SET rotation_start date(2022,1,1)
    IF $U >= rotation_start
      # the "%4" is the number of servers in the list
      FSET server(dt) choose( \
        1 + (nonomitted(rotation_start, dt, "Sat", "Sun") % 4), \
        "Server A", \
        "Server B", \
        "Server C", \
        "Server D" \
        )
      REM OMIT Sat Sun SKIP MSG [server($T)]
    ENDIF
  POP

which seems to do the trick based on what I see:

  $ rem -c 2022-1-1

I'm not sure if there's a way to remove the Sat/Sun redundancy
between the REM statement and the nonomitted() call, but I think this
gives you what you're looking for.

(I might have a special place in my heart for the nonomitted()
function because I grew up on a 6-day school cycle and having
something like this would have made it MUCH easier to keep track of
which day was which.)

-tim





More information about the Remind-fans mailing list