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

This is general talk area for things that NOT RELATED WITH TV! Instead, about internal works like web site, forum, wiki, or talking, etc...

sectroyer
Official SamyGO Developer
Posts: 5628
Joined: Wed May 04, 2011 5:10 pm

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

Post by sectroyer » Wed Jul 20, 2016 8:19 pm

In your init you should launch script (with &) that will have the loop :) That's how you should do it :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on http://ctrlv.it/ Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!

smart_lover
SamyGO Project Donor
Posts: 158
Joined: Sun May 03, 2015 6:11 am

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

Post by smart_lover » Wed Jul 20, 2016 8:25 pm

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

sectroyer
Official SamyGO Developer
Posts: 5628
Joined: Wed May 04, 2011 5:10 pm

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

Post by sectroyer » Wed Jul 20, 2016 9:59 pm

At:
yourscriptsname.sh & <<<<<----- HERE :)
I do NOT support "latest fw" at ALL. If you have one you should block updates on router and wait for it to STOP being "latest":)
If you want me to help you please paste FULL log(s) to "spoiler"/"code" bbcodes or provide link(s) to pasted file(s) on http://ctrlv.it/ Otherwise "NO HELP"!!!
If you want root DISABLE internet access to your device!!!!
DO NOT EVER INSTALL FIRMWARE UPGRADE !!!!

smart_lover
SamyGO Project Donor
Posts: 158
Joined: Sun May 03, 2015 6:11 am

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

Post by smart_lover » Fri Jul 22, 2016 4:20 pm

juusso wrote:
smart_lover wrote:Does this lib works in H series?
I guess it should. Try and tell us ;)
It works very well.

Post Reply

Return to “General”