News for hackers. Stuff that matters.
Re:OpenBSD cron(8) now supports random ranges with steps by networked on Monday May 08, 2023 @01:32PM (#35864472)
Nice! To me this is a minor but meaningful differentiator for OpenBSD. It is similar to the "random" feature in my favorite cron, fcron: http://fcron.free.fr/doc/en/fcrontab.5.html#FCRONTAB.5.RANDO....

In crons that do not support something like this, you can introduce a random delay with a Perl oneliner. For example,

  # Start within the first 10 minutes of the matching hour.
  0 */8 * * * perl -e 'sleep rand 10 * 60' && ~/.config/jobs/fetch-tcl-logs
Re:OpenBSD cron(8) now supports random ranges with steps by yakubin on Monday May 08, 2023 @04:28PM (#35866635)
And if you have jot, but not Perl, like on a bare FreeBSD install:

  0 */8 * * * sleep "$(jot -r 1 0 599)" && ~/.config/jobs/fetch-tcl-logs
Re:OpenBSD cron(8) now supports random ranges with steps by zeroimpl on Monday May 08, 2023 @06:57PM (#35868023)
Might as well just use bash

    sleep $((RANDOM % 600)) && fetch-tcl-logs