title: User not allowed to use crontab
body: <p>I want to edit cron tab daily to delete / add some jobs .. so I added cron job ( helper job ) to run php script to handle these edits.</p>
  <p>When I run this script by browser works fine .. but when it runs using the helper job not running and I receive notification mail from cpanel with this error :</p>
  <p><strong>Please note I am on shared hosting plan with C-Panel so I have no root access .. but the code working fine when run from browser.</strong></p>
  <p><strong>Error:</strong></p>
  <pre><code>You (dcfn35c8st1b) are not allowed to use this program (crontab)
  See crontab(1) for more information
  You (dcfn35c8st1b) are not allowed to use this program (crontab)
  See crontab(1) for more information
  You (dcfn35c8st1b) are not allowed to use this program (crontab)
  See crontab(1) for more information
  You (dcfn35c8st1b) are not allowed to use this program (crontab)
  See crontab(1) for more information
  You (dcfn35c8st1b) are not allowed to use this program (crontab)
  See crontab(1) for more information
  </code></pre>
  <p><strong>PHP Script:</strong></p>
  <pre><code>exec('crontab -l', $crontab);
  $record_found = false;
  foreach($crontab as $key =&gt; $value){
      if(strpos($value, 'record_extra.php') !== false){
          //echo $key . ' ' . $value . '&lt;br&gt;';
          unset($crontab[$key]);
          $record_found = true;
      }
          if(strpos($value, 'record.php') !== false){
          //echo $key . ' ' . $value . '&lt;br&gt;';
          unset($crontab[$key]);
      }
  }
  if($record_found){
      file_put_contents('/tmp/crontab.txt', arrayToString($crontab) . $firstJob.PHP_EOL);
      if(exec('crontab /tmp/crontab.txt')){
          //echo 'success &lt;br&gt;'; 
      } else {
          //echo 'error &lt;br&gt;'; 
      }
      $output = shell_exec('crontab -l');
      file_put_contents('/tmp/crontab.txt', $output . $secondJob.PHP_EOL);
      if(exec('crontab /tmp/crontab.txt')){
          //echo 'success &lt;br&gt;'; 
      } else {
          //echo 'error &lt;br&gt;'; 
      }
  } else {
      $output = shell_exec('crontab -l');
      file_put_contents('/tmp/crontab.txt', $output . $firstJob.PHP_EOL);
      if(exec('crontab /tmp/crontab.txt')){
          //echo 'success &lt;br&gt;'; 
      } else {
          //echo 'error &lt;br&gt;'; 
      }
      $output = shell_exec('crontab -l');
      file_put_contents('/tmp/crontab.txt', $output . $secondJob.PHP_EOL);
      if(exec('crontab /tmp/crontab.txt')){
          //echo 'success &lt;br&gt;'; 
      } else {
          //echo 'error &lt;br&gt;'; 
      }
  }
  </code></pre>
  <p><em>Need your help.
  Thanks in advance.</em></p>