a boincRnice command for fedora


log in

Advanced search

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

Author Message
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

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

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

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

Copyright © 2014 University of California