a boincRnice command for fedora

Questions and Answers : Unix/Linux : a boincRnice command for fedora
Message board moderation

To post messages, you must log in.

AuthorMessage
wlh2008
Avatar

Send message
Joined: 25 Aug 09
Posts: 8
Credit: 11,432
RAC: 0
United States
Message 934726 - Posted: 20 Sep 2009, 4:33:23 UTC

#
# boincRnice - change the nice value of boinc procs
#
# call as "boincRnice 5" to change value to 5
#

$SUDO=""

# Not a privileged user - use sudo
if [ `id -u` != 0 ] ; then
$SUDO=sudo
fi


for procid in `ps -elfa|grep boinc|grep -v grep|cut -d ' ' -f 8`
do
$SUDO renice $1 $procid;
done
ID: 934726 · Report as offensive
wlh2008
Avatar

Send message
Joined: 25 Aug 09
Posts: 8
Credit: 11,432
RAC: 0
United States
Message 934748 - Posted: 20 Sep 2009, 5:34:35 UTC - in response to Message 934726.  

oops - should have been::

#
# boincRnice - change the nice value of boinc procs
#
# call as "boincRnice 5" to change value to 5
#

SUDO=""

# Not a privileged user - use sudo
if [ `id -u` != 0 ] ; then
SUDO=sudo
fi


for procid in `ps -elfa|grep boinc|grep -v grep|cut -d ' ' -f 8`
do
$SUDO renice $1 $procid;
done

ID: 934748 · Report as offensive
wlh2008
Avatar

Send message
Joined: 25 Aug 09
Posts: 8
Credit: 11,432
RAC: 0
United States
Message 934790 - Posted: 20 Sep 2009, 14:52:33 UTC - in response to Message 934726.  

A better way of doing the pid list. THE FIRST WAY DOES NOT WORK CORRECTLY.

#
# boincRnice - change the nice value of boinc procs
#
# call as "boincRnice 5" to change value to 5
#

$SUDO=""

# Not a privileged user - use sudo
if [ `id -u` != 0 ] ; then
$SUDO=sudo
fi


for procid in `ps -o pid --user boinc`
do
$SUDO renice $1 $procid;
done

ID: 934790 · Report as offensive

Questions and Answers : Unix/Linux : a boincRnice command for fedora


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.