I need a Perl or Shell script that will poll, say the top 10 CPU processes
given by "top" every 30 secs & if after polling 8 times & a particular
process CPU consumption is above 70% for all the 8 polls, then it will
renice the process to a friendlier priority.
Below is one script but it's not quite what I wanted
Preferably this script runs from crontab : if in cron we can only set to
run every minute, then this script will have to run twice per minute,
say by placing a "sleep 30 secs" ?
attached a sample but it's not quite I wanted