|
|
|
|
|
by stephenr
2219 days ago
|
|
I'd imagine that systemd timers would work here, and I would imagine would be less work than having to have 200 jobs in some 3rd party service. A few ideas off the top of my head: write a unit template and use the instance parameter to designate an offset; or write a single unit template with the `OnCalendar` property set to `*:00:00/3:00:00` and `RandomizedDelaySec` set to (10800) (3 hours in seconds). Of course, the same basic effect is also possible with traditional cron. Certbot's Debian package has a pretty basic example of how to do basically what you want: have the job set to run every 3 hours, and then have the command be something akin to: `perl -e 'sleep int(rand(10800))' && <your command>` - it's the exact same high level logic as the systemd approach, but you're inserting the delay yourself using a `sleep` call. I'd personally very much go for the systemd approach but either should work. |
|