I need to run a process
A as much resources as possible when the machine is free, but gives out CPU once there's high-priority processes are started.
Any suggestions? Thanks!
There are few ways to achieve what you want. You can use
cpulimit to limit the cpu usage. You are in right direction by giving nice -19 right command to give niceness is
nice -n 19 Program name.
Maximum overkill is to use a process scheduler such as HTCondor or SLURM, though this perhaps better suits larger numbers of systems and where there is sufficient knowledge around to setup and maintain the scheduler. These schedulers offer all sorts of means to divvy up CPU and other resources (at the cost of a not so simple learning curve).