> >> 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. > > >> And the former achieves a resolution of seconds instead of minutes. > > > > Why do you need that? > > The original issue > involved updates to a DDNS service where the server side had high load
How high? > around full minutes, full 5 minutes, etc. This was most likely caused > by bunching up of requests from cron tasks around those times. Do you mean cron tasks running at the (many) _clients_ using that server? > Since most hosts use NTP to synchronise their clocks, > most of the cron-triggered tasks will run almost exactly on full minutes. Yes. So these DDNS clients need to run their script inside every minute? Why? What does that script do? > So if many hosts do this the server side gets a load peak at that time. > The object was to find a way to distribute the requests better. I suspect you are overcomplicating it. Why do all the clients need to run a script (inside) every minute, and how much load does it create for the server, and why is it a problem? > > Are you prepared for the situation when the script runs on the 59th second > > of one minute, and on the 01th second of the next minute? > > Yes, I’m aware of that issue. Not so much different in concept > than a ~/13 * * * * specifier shortening the interval at > the end of the hour to less than the regular interval. In concept, yes, but these runs will still be started minutes apart, as opposed to seconds apart. > The solution is to use a more complicated expression That very sentence should make you stop :-) Jan