Running a script every second

Laurent Bercot ska-dietlibc at skarnet.org
Wed Mar 5 18:07:22 UTC 2014


On 2014-03-05 17:40, Yan Seiner wrote:
>> I am trying to run a script every second.  I set up two scripts:

  Very dumb question: if your script execution time is much smaller
than one second, why not simply "while true ; do update ; sleep 1 ; done" ?
(Or better, "update ; exec sleep 1" in a runit/s6/... run script.)

  If your script execution time is not negligible compared to one second,
you could replace "update" with "update &".
  If "update"'s execution time can go over one second, then you need to make
it reentrant, but it's the same with your SIGHUP and fifo system.

-- 
  Laurent



More information about the busybox mailing list