On Thu, 31 Dec 2020 16:54:15 -0800 Kenneth Porter wrote: > With the discussion of the KAM channel and Fedora's sa-update script > that uses directory-based channel configuration, I went snooping into > their script and systemd units. It looks like sa-update.cron has a > 2-hour random delay before it looks for updates. I'm thinking it > would be nice to move that delay into the systemd timer unit using > the RandomizedDelaySec feature. This would allow the script to be run > from the command line for immediate testing without waiting for the > delay. The delay would be done by systemd, instead.
I don't know whether this is completely specific to Fedora and systemd, but if you want it to be more generic you can do following in the script: if ! [ -t 0 ]; then do_random_delay fi