Thanks everyone who found the solution. The issue was indeed the unescaped % in the crontab entry.
I had missed that while looking into the problem and mistakenly concluded that RANDOM was somehow at fault. Note: The rest of the discussion around what lead to the issue and my original post is OT for this list, as it doesn’t pertain to OpenBSD. So I’m not going to continue that discussion here to avoid boring the rest of the list subscribers ;-) Mike > Am 17.05.2025 um 11:31 schrieb Marcus MERIGHI <mcmer-open...@tor.at>: > > fischer+o...@lavielle.com (Mike Fischer), 2025.05.16 (Fri) 17:53 (CEST): >>> Am 16.05.2025 um 17:33 schrieb Jan Stary <h...@stare.cz>: >>>>> How exactly are you using RANDOM in a crontab, >>>> * * * * * time $((RANDOM % 60));/home/username/bin/script.sh >>> That doesn't make any sense: do you mean sleep(1) instead of time(1)? >> Sorry, yes. sleep is correct. >>> Show the actual lines from the actual crontab -l >>>> The (intended) semantics are slightly different from >>>> ~ * * * * /home/username/bin/script.sh >>>> The latter calculates the random value once when the crontab is loaded, >>>> while the former calculates it each time the crontab entry is triggered. >>> Why do you need that? >> a) To get more randomness. >> b) To get seconds resolution instead of minutes. > > I found an old crontab(5) entry from the dark ages when we did not have "~": > > #5 * * * * sleep $((RANDOM \% 2048)) && > /usr/libexec/spamd-setup > > Here you see what guenther@ already told you: "%" is special in > crontab(5)s. > > Marcus >