On Wed, Jul 03, 2024 at 10:52:46AM -0300, K R wrote:
> >Synopsis:      crontab(5) clarification:  "~" field is evaluated once at 
> >install time
> >Category:      documentation system amd64
> >Environment:
>         System      : OpenBSD 7.5
>         Details     : OpenBSD 7.5-current (GENERIC) #150: Wed Jun 26
> 20:30:54 MDT 2024
> 
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
> 
>         Architecture: OpenBSD.amd64
>         Machine     : amd64
> >Description:
>         The crontab(5) manpage could be more explicit about the fact
>         that a "~" char only gets evaluated to a random value once, at
>         table install time.
> 
>         From the EXAMPLES section:
> 
>         # run hourly at a random time within the first 30 minutes of the hour
>         0~30 * * * *   /usr/libexec/spamd-setup
> 
>         "run hourly at a random time" could me interpreted as "run
>         hourly, with a different random minute every hour".
>         This is not the case and may be unexpected for some users.
> 
> >How-To-Repeat:
>         # some initial random minute, repeating itself every hour
>         ~ * * * *   date >> /tmp/LOG
> 
> >Fix:
>         Just clarify that "~" will be evaluated at table install time
>         and then be reused.
> 
>         Thanks,
>         --Kor
> 

hi.

i agree it might not be totally clear, initially, that it works that
way. but if you think about it, if it ran at, for example, different
minute intervals, then you could have something run at 59 minutes past
the hour, and then at 1 minute past the next hour - a difference of two
minutes. that would hardly qualify as "hourly".

i think the doc provides enough of a hint ("a radom value ... may be
obtained") when combined with that logic. i'm not sure that adding the
extra text to try and explain that would be worth it. if you feel
unconvinced by that, propose a text which you think improves it. but i'm
not sure it's needed.

jmc

Reply via email to