title: how can I lower the CPU and I/O priority of a cron script?
body: <p>I want to run a script via cron at low I/O and CPU priority. If I understand correctly (and I might not), I could just add <code>proc_nice(10);</code> to my script to lower the CPU priority, but there is no PHP equivalent for I/O priority.</p>
  
  <p>There appears to be a shell command <code>ionice</code> for this, but I am a linux idiot, and I don't know what I am doing. Would this be the correct line for my cron file if I want to use both nice and ionice to lower the priority of the script in question?</p>
  
  <pre><code>0 * * * * /usr/bin/nice -n 10 /usr/bin/ionice -c 3 /path/php/bin/php /path/script.php
  </code></pre>
  
  <p>I got the <code>-c3</code> parameter from <a href="http://friedcpu.wordpress.com/2007/07/17/why-arent-you-using-ionice-yet/" rel="nofollow">here</a> ("places the process in the idle scheduling class"), and I'm not confident that's what I want.</p>
  
  <p>Is there a benefit to using the PHP call to <code>proc_nice()</code> rather than this method?</p>
  
  <p>EDIT: my cron script is not running using the above, so I've definitely misunderstood something</p>