Most Linux folks are familiar with the NICE command, which adjusts the priority with which a process runs. You can use NICE to put a program like printing or FTP downloading into the background so that your other processes aren't impacted, or promote a process to the foreground to make that process run more quickly. A related command, RENICE lets you continue to run a process in the background when you logoff your system.
Let's assume that you are running a program in the background and you have to head home from work. First you need to know the Process ID (PID) of your program:
ps –a | programname
which returns a set of values:
1234 pts/2 20:10 programname.
This indicates that the PID is 1234 and it is being run at tty2. The RENICE command:
renice -n PRI -p PID
would then have its PRI or priority set with the PID number. The range of RENICE (as is true of NICE itself) is 19 to -19. So to put this program into the background you would enter:
renice -n 19 -p 1234
This command lowers the priority from 0 to -19 and programname runs only when the system is idle, and doesn't impact on other users. With luck your process will be complete when you return, or failing that would have more efficiently used your system resources.
You can find a description of RENICE parameters
Barrie Sosinsky is president of consulting company Sosinsky and Associates (Medfield MA). He has written extensively on a variety of computer topics. His company specializes in custom software (database and Web related), training and technical documentation.
This was first published in October 2003