NUKA

Quite a long time these “sleeping box” I torvyat health 🙂 In the specific work and work and at some point it crashes the receiver and a reboot is required for CAM module. In my case I use newcs and mgcamd to decode programs and when zabierze any program mgcamd process develops develops stoimosti order 80-90% the commander of computing power 🙂 was Clear the disease was a SIMP only medicine I need 😉 good, but myricetin not my 500s features a large team, for example ps no u the argument top no -p etc really hate busybox 😆 until, like political liberalism, let me get to the point 🙂 All necessary information is contained in the folder /works after quite a read ahead of the back, and then to help, my good pritel ShadowX without which it were not, I came up with an amazing script click 🙂 Също така и моя прител Nathariel които ми търпеше жуженето през цялото време 😉 ХАХ типично за мен започвам да обяснвам нещо започвам второ трето и пето 🙂 хахахах Така стига дивотии ами да взема да се хваля колко готен програмист съм 😉

The most important structure in the script

# Get usage cpu time
cputime=`cat /proc/uptime | awk '{print $1}' | sed 's/\.//'`
# Get process usage cpu time
proctime=`cat /proc/${procpid}/stat | awk '{t = $14 + $15;print t}'`
# wait 5 seconds
sleep 5
# get usage cpu time, again
cputime2=`cat /proc/uptime | awk '{print $1}' | sed 's/\.//'`
# get process usage cpu time, again
proctime2=`cat /proc/$procpid/stat | awk '{t = $14 + $15;print t}'`
# calculate process usage cpu time over total usage cpu time as percentage
cpu=$((($proctime2-$proctime)*100/($cputime2-$cputime)))
# limit exceed check
echo CPU usage for PID $procpid is $cpu
if [ $cpu -gt $MAX ];
then
reboot
fi

in General, well, I described her with komentarze how well a child 😉 in General is the heart of the script takes stoinost /proc/ide-process/stat and sledtova read stoinosta 5 seconds. Formulkata for ichislyavane crystal clear to understand and a second-grader will solve it easily. Something very important that optimization be, what script to use ash which is quite uncomfortable akylzhan if you used ligne on 猛击 😉 In stranichkina scenario I described in detail the technology works and the logic of use. I will be glad of the opinions, recommendations and error report, because the head is not enough 🙂

leave a reply

Your email address will not be published. Required fields are marked *

anti SPAM *