Page 2 of 2

Re: What is the best way to run a bash script periodically?

Posted: Wed Jul 20, 2016 8:19 pm
by sectroyer
In your init you should launch script (with &) that will have the loop :) That's how you should do it :)

Re: What is the best way to run a bash script periodically?

Posted: Wed Jul 20, 2016 8:25 pm
by smart_lover
sectroyer wrote:In your init you should launch script (with &) that will have the loop :) That's how you should do it :)
Actually I confused. How can I launch my script in init?

In which place of following script(my script) I have to place '&'?

Code: Select all

#!/bin/sh

upSeconds="$(cat /proc/uptime | grep -o '^[0-9]\+')"
upMins=$((${upSeconds} / 60))

until [ "${upMins}" -gt "2880" ] ; do
   sleep 30m
   upSeconds="$(cat /proc/uptime | grep -o '^[0-9]\+')"
   upMins=$((${upSeconds} / 60))
done
samyGOrc -p $(pidof exeTV || pidof exeDSP) 152

Re: What is the best way to run a bash script periodically?

Posted: Wed Jul 20, 2016 9:59 pm
by sectroyer
At:
yourscriptsname.sh & <<<<<----- HERE :)

Re: What is the best way to run a bash script periodically?

Posted: Fri Jul 22, 2016 4:20 pm
by smart_lover
juusso wrote:
smart_lover wrote:Does this lib works in H series?
I guess it should. Try and tell us ;)
It works very well.